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>,

source

pub closed spec fn instance_id(self) -> InstanceId

source

pub closed spec fn multiset(self) -> Multiset<Element>

source

pub proof fn empty(instance_id: InstanceId) -> tracked s : Self

ensures
s.instance_id() == instance_id,
s.multiset() === Multiset::empty(),
source

pub proof fn insert(tracked &mut self, tracked token: Token)

requires
old(self).instance_id() == token.instance_id(),
ensures
self.instance_id() == old(self).instance_id(),
self.multiset() == old(self).multiset().insert(token.element()),
source

pub proof fn remove(tracked &mut self, element: Element) -> tracked token : Token

requires
old(self).multiset().contains(element),
ensures
self.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>
where Element: Send, Token: Send,

§

impl<Element, Token> Sync for MultisetToken<Element, Token>
where Element: Sync, Token: Sync,

§

impl<Element, Token> Unpin for MultisetToken<Element, Token>
where Element: Unpin, Token: Unpin,

§

impl<Element, Token> UnwindSafe for MultisetToken<Element, Token>
where Element: UnwindSafe, Token: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.