pub struct SetToken<Element, Token>where
Token: ElementToken<Element>,{ /* private fields */ }
Implementations§
source§impl<Element, Token> SetToken<Element, Token>where
Token: ElementToken<Element>,
impl<Element, Token> SetToken<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.set() === Set::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.set() == old(self).set().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).set().contains(element),
ensuresself.instance_id() == old(self).instance_id(),
self.set() == old(self).set().remove(element),
token.instance_id() == self.instance_id(),
token.element() == element,
sourcepub proof fn into_map(tracked self) -> tracked map : Map<Element, Token>
pub proof fn into_map(tracked self) -> tracked map : Map<Element, Token>
ensures
map.dom() == self.set(),
forall |key| {
map.dom().contains(key)
==> map[key].instance_id() == self.instance_id() && map[key].element() == key
},
sourcepub proof fn from_map(instance_id: InstanceId, tracked map: Map<Element, Token>) -> tracked s : Self
pub proof fn from_map(instance_id: InstanceId, tracked map: Map<Element, Token>) -> tracked s : Self
requires
forall |key| #[trigger] map.dom().contains(key) ==> map[key].instance_id() == instance_id,
forall |key| #[trigger] map.dom().contains(key) ==> map[key].element() == key,
ensuress.instance_id() == instance_id,
s.set() == map.dom(),
Auto Trait Implementations§
impl<Element, Token> Freeze for SetToken<Element, Token>
impl<Element, Token> RefUnwindSafe for SetToken<Element, Token>where
Element: RefUnwindSafe,
Token: RefUnwindSafe,
impl<Element, Token> Send for SetToken<Element, Token>
impl<Element, Token> Sync for SetToken<Element, Token>
impl<Element, Token> Unpin for SetToken<Element, Token>
impl<Element, Token> UnwindSafe for SetToken<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