Struct erg_common::dict::Dict
source · pub struct Dict<K, V> { /* private fields */ }
Implementations§
source§impl<K, V> Dict<K, V>
impl<K, V> Dict<K, V>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> usize
pub fn keys(&self) -> Keys<'_, K, V>
pub fn values(&self) -> Values<'_, K, V>
pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>
pub fn into_values(self) -> IntoValues<K, V>
pub fn iter(&self) -> Iter<'_, K, V>
pub fn iter_mut(&mut self) -> IterMut<'_, K, V>
pub fn clear(&mut self)
source§impl<K: Hash + Eq, V> Dict<K, V>
impl<K: Hash + Eq, V> Dict<K, V>
pub fn get<Q>(&self, k: &Q) -> Option<&V>where K: Borrow<Q>, Q: Hash + Eq + ?Sized,
pub fn get_by(&self, k: &K, cmp: impl Fn(&K, &K) -> bool) -> Option<&V>
pub fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut V>where K: Borrow<Q>, Q: Hash + Eq + ?Sized,
pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>where K: Borrow<Q>, Q: Hash + Eq + ?Sized,
pub fn contains_key<Q>(&self, k: &Q) -> boolwhere K: Borrow<Q>, Q: Hash + Eq + ?Sized,
pub fn insert(&mut self, k: K, v: V) -> Option<V>
pub fn remove<Q>(&mut self, k: &Q) -> Option<V>where K: Borrow<Q>, Q: Hash + Eq + ?Sized,
pub fn remove_entry<Q>(&mut self, k: &Q) -> Option<(K, V)>where K: Borrow<Q>, Q: Hash + Eq + ?Sized,
sourcepub fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
pub fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
NOTE: This method does not consider pairing with values and keys. That is, a value may be paired with a different key (can be considered equal).
If you need to consider the pairing of the keys and values, use guaranteed_extend
instead.