pub struct VecMap<K, V> { /* private fields */ }Expand description
A drop in replacement for std::collections::HashMap for extensive documentation and examples, see the original data
structure.
Implementations§
Source§impl<K, V> VecMap<K, V>where
K: Eq,
impl<K, V> VecMap<K, V>where
K: Eq,
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of elements the map can hold without reallocating.
pub fn reserve(&mut self, additional: usize)
pub fn len(&self) -> usize
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)>
pub fn get<Q>(&self, k: &Q) -> Option<&V>
pub fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut V>
pub fn contains_key<Q>(&self, k: &Q) -> bool
pub fn shrink_to_fit(&mut self)
pub fn shrink_to(&mut self, min_capacity: usize)
pub fn entry(&mut self, key: K) -> Entry<'_, K, V>
pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>
pub fn keys(&self) -> Keys<'_, K, V> ⓘ
pub fn into_keys(self) -> IntoKeys<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 is_empty(&self) -> bool
pub fn drain(&mut self) -> Drain<'_, K, V> ⓘ
pub fn retain<F>(&mut self, f: F)
pub fn clear(&mut self)
pub fn hasher<S>(&self) -> &Swhere
S: BuildHasher,
Trait Implementations§
Source§impl<'a, K, V> Extend<(&'a K, &'a V)> for VecMap<K, V>
impl<'a, K, V> Extend<(&'a K, &'a V)> for VecMap<K, V>
Source§fn extend<T: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<K, V> Extend<(K, V)> for VecMap<K, V>where
K: Eq,
impl<K, V> Extend<(K, V)> for VecMap<K, V>where
K: Eq,
Source§fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<'a, K, V> IntoIterator for &'a VecMap<K, V>
impl<'a, K, V> IntoIterator for &'a VecMap<K, V>
Source§impl<'a, K, V> IntoIterator for &'a mut VecMap<K, V>
impl<'a, K, V> IntoIterator for &'a mut VecMap<K, V>
Source§impl<K, V> IntoIterator for VecMap<K, V>where
K: Eq,
impl<K, V> IntoIterator for VecMap<K, V>where
K: Eq,
impl<K: Eq, V: Eq> Eq for VecMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for VecMap<K, V>
impl<K, V> RefUnwindSafe for VecMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for VecMap<K, V>
impl<K, V> Sync for VecMap<K, V>
impl<K, V> Unpin for VecMap<K, V>
impl<K, V> UnwindSafe for VecMap<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