pub struct NonIterMap<K: Eq + Hash, V, S: BuildHasher = DefaultHashBuilder>(/* private fields */);
Expand description
A thin wrapper around a HashMap
, which guarantees that a HashMap
usage will not
result in a non-deterministic execution (simply by disallowing the iteration over its
elements).
Implementations§
Source§impl<K: Hash + Eq, V> NonIterMap<K, V>
impl<K: Hash + Eq, V> NonIterMap<K, V>
Sourcepub fn entry(&mut self, key: K) -> Entry<'_, K, V>
pub fn entry(&mut self, key: K) -> Entry<'_, K, V>
Gets the given key’s corresponding entry in the map for in-place manipulation.
Sourcepub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
Inserts a key-value pair into the map. If the map did not have this key present, None is returned. If the map did have this key present, the value is updated, and the old value is returned.
Sourcepub fn get<Q>(&self, key: &Q) -> Option<&V>
pub fn get<Q>(&self, key: &Q) -> Option<&V>
Returns a reference to the value corresponding to the key.
Sourcepub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
Returns a mutable reference to the value corresponding to the key.
Sourcepub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn contains_key<Q>(&self, key: &Q) -> bool
Returns true if the map contains a value for the specified key.
Trait Implementations§
Source§impl<K: Clone + Eq + Hash, V: Clone, S: Clone + BuildHasher> Clone for NonIterMap<K, V, S>
impl<K: Clone + Eq + Hash, V: Clone, S: Clone + BuildHasher> Clone for NonIterMap<K, V, S>
Source§fn clone(&self) -> NonIterMap<K, V, S>
fn clone(&self) -> NonIterMap<K, V, S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<K: Debug + Eq + Hash, V: Debug, S: Debug + BuildHasher> Debug for NonIterMap<K, V, S>
impl<K: Debug + Eq + Hash, V: Debug, S: Debug + BuildHasher> Debug for NonIterMap<K, V, S>
Source§impl<K: Hash + Eq, V> FromIterator<(K, V)> for NonIterMap<K, V>
impl<K: Hash + Eq, V> FromIterator<(K, V)> for NonIterMap<K, V>
Source§impl<K: PartialEq + Eq + Hash, V: PartialEq, S: PartialEq + BuildHasher> PartialEq for NonIterMap<K, V, S>
impl<K: PartialEq + Eq + Hash, V: PartialEq, S: PartialEq + BuildHasher> PartialEq for NonIterMap<K, V, S>
impl<K: Eq + Eq + Hash, V: Eq, S: Eq + BuildHasher> Eq for NonIterMap<K, V, S>
impl<K: Eq + Hash, V, S: BuildHasher> StructuralPartialEq for NonIterMap<K, V, S>
Auto Trait Implementations§
impl<K, V, S> Freeze for NonIterMap<K, V, S>where
S: Freeze,
impl<K, V, S> RefUnwindSafe for NonIterMap<K, V, S>
impl<K, V, S> Send for NonIterMap<K, V, S>
impl<K, V, S> Sync for NonIterMap<K, V, S>
impl<K, V, S> Unpin for NonIterMap<K, V, S>
impl<K, V, S> UnwindSafe for NonIterMap<K, V, S>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.