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>
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>
pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>
pub fn contains_key<Q>(&self, k: &Q) -> bool
pub fn insert(&mut self, k: K, v: V) -> Option<V>
pub fn remove<Q>(&mut self, k: &Q) -> Option<V>
pub fn remove_entry<Q>(&mut self, k: &Q) -> Option<(K, V)>
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.
pub fn guaranteed_extend<I: IntoIterator<Item = (K, V)>>(&mut self, other: I)
pub fn merge(&mut self, other: Self)
pub fn concat(self, other: Self) -> Self
pub fn diff(self, other: &Self) -> Self
pub fn entry(&mut self, k: K) -> Entry<'_, K, V>
Trait Implementations§
source§impl<K, V> IntoIterator for Dict<K, V>
impl<K, V> IntoIterator for Dict<K, V>
source§impl<K: Hash + Eq, V: Hash + Eq> PartialEq for Dict<K, V>
impl<K: Hash + Eq, V: Hash + Eq> PartialEq for Dict<K, V>
impl<K: Hash + Eq, V: Hash + Eq> Eq for Dict<K, V>
Auto Trait Implementations§
impl<K, V> RefUnwindSafe for Dict<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Dict<K, V>
impl<K, V> Sync for Dict<K, V>
impl<K, V> Unpin for Dict<K, V>
impl<K, V> UnwindSafe for Dict<K, V>where
K: UnwindSafe,
V: 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