Struct vstd::hash_map::HashMapWithView
source · pub struct HashMapWithView<Key, Value>{ /* private fields */ }
Implementations§
source§impl<Key, Value> HashMapWithView<Key, Value>
impl<Key, Value> HashMapWithView<Key, Value>
sourcepub exec fn new() -> result : Self
pub exec fn new() -> result : Self
requires
obeys_key_model::<Key>(),
forall |k1: Key, k2: Key| k1@ == k2@ ==> k1 == k2,
ensuresresult@ == Map::<<Key as View>::V, Value>::empty(),
sourcepub exec fn with_capacity(capacity: usize) -> result : Self
pub exec fn with_capacity(capacity: usize) -> result : Self
requires
obeys_key_model::<Key>(),
forall |k1: Key, k2: Key| k1@ == k2@ ==> k1 == k2,
ensuresresult@ == Map::<<Key as View>::V, Value>::empty(),
sourcepub exec fn contains_key(&self, k: &Key) -> result : bool
pub exec fn contains_key(&self, k: &Key) -> result : bool
ensures
result == self@.contains_key(k@),
sourcepub exec fn get<'a>(&'a self, k: &Key) -> result : Option<&'a Value>
pub exec fn get<'a>(&'a self, k: &Key) -> result : Option<&'a Value>
ensures
match result {
Some(v) => self@.contains_key(k@) && *v == self@[k@],
None => !self@.contains_key(k@),
},
sourcepub exec fn union_prefer_right(&mut self, other: Self)
pub exec fn union_prefer_right(&mut self, other: Self)
ensures
self@ == old(self)@.union_prefer_right(other@),
Trait Implementations§
Auto Trait Implementations§
impl<Key, Value> RefUnwindSafe for HashMapWithView<Key, Value>where
Key: RefUnwindSafe,
Value: RefUnwindSafe,
impl<Key, Value> Send for HashMapWithView<Key, Value>
impl<Key, Value> Sync for HashMapWithView<Key, Value>
impl<Key, Value> Unpin for HashMapWithView<Key, Value>
impl<Key, Value> UnwindSafe for HashMapWithView<Key, Value>where
Key: UnwindSafe,
Value: 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