Struct vstd::tokens::MultisetToken
source · pub struct MultisetToken<Element, Token>where
Token: ElementToken<Element>,{ /* private fields */ }
Implementations§
source§impl<Element, Token> MultisetToken<Element, Token>where
Token: ElementToken<Element>,
impl<Element, Token> MultisetToken<Element, Token>where
Token: ElementToken<Element>,
sourcepub closed spec fn instance_id(self) -> InstanceId
pub closed spec fn instance_id(self) -> InstanceId
sourcepub proof fn empty(instance_id: InstanceId) -> tracked s : Self
pub proof fn empty(instance_id: InstanceId) -> tracked s : Self
ensures
s.instance_id() == instance_id,
s.multiset() === Multiset::empty(),
sourcepub proof fn insert(tracked &mut self, tracked token: Token)
pub proof fn insert(tracked &mut self, tracked token: Token)
requires
old(self).instance_id() == token.instance_id(),
ensuresself.instance_id() == old(self).instance_id(),
self.multiset() == old(self).multiset().insert(token.element()),
sourcepub proof fn remove(tracked &mut self, element: Element) -> tracked token : Token
pub proof fn remove(tracked &mut self, element: Element) -> tracked token : Token
requires
old(self).multiset().contains(element),
ensuresself.instance_id() == old(self).instance_id(),
self.multiset() == old(self).multiset().remove(element),
token.instance_id() == self.instance_id(),
token.element() == element,
Auto Trait Implementations§
impl<Element, Token> Freeze for MultisetToken<Element, Token>
impl<Element, Token> RefUnwindSafe for MultisetToken<Element, Token>where
Element: RefUnwindSafe,
Token: RefUnwindSafe,
impl<Element, Token> Send for MultisetToken<Element, Token>
impl<Element, Token> Sync for MultisetToken<Element, Token>
impl<Element, Token> Unpin for MultisetToken<Element, Token>
impl<Element, Token> UnwindSafe for MultisetToken<Element, Token>where
Element: UnwindSafe,
Token: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more