pub struct DenseMap<K, V> { /* private fields */ }Expand description
An associative index over densely packed records. Hash buckets contain only keys and slots, so growing the index does not move large compiler records.
Implementations§
Source§impl<K: Eq + Hash + Clone, V> DenseMap<K, V>
impl<K: Eq + Hash + Clone, V> DenseMap<K, V>
pub fn insert_if_absent(&mut self, key: K, value: V)
pub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn get<Q: Eq + Hash + ?Sized>(&self, key: &Q) -> Option<&V>where
K: Borrow<Q>,
pub fn get_mut<Q: Eq + Hash + ?Sized>(&mut self, key: &Q) -> Option<&mut V>where
K: Borrow<Q>,
pub fn contains_key<Q: Eq + Hash + ?Sized>(&self, key: &Q) -> boolwhere
K: Borrow<Q>,
pub fn retain(&mut self, keep: impl FnMut(&K, &mut V) -> bool)
Trait Implementations§
Source§impl<K: Eq + Hash + Clone, V> Extend<(K, V)> for DenseMap<K, V>
impl<K: Eq + Hash + Clone, V> Extend<(K, V)> for DenseMap<K, V>
Source§fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, entries: I)
fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, entries: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬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: Eq + Hash + Clone + Borrow<Q>, V, Q: Eq + Hash + ?Sized> Index<&Q> for DenseMap<K, V>
impl<K: Eq + Hash + Clone + Borrow<Q>, V, Q: Eq + Hash + ?Sized> Index<&Q> for DenseMap<K, V>
Source§impl<K, V> IntoIterator for DenseMap<K, V>
impl<K, V> IntoIterator for DenseMap<K, V>
Source§impl<'a, K, V> IntoIterator for &'a DenseMap<K, V>
impl<'a, K, V> IntoIterator for &'a DenseMap<K, V>
Auto Trait Implementations§
impl<K, V> Forget for DenseMap<K, V>
impl<K, V> Freeze for DenseMap<K, V>
impl<K, V> RefUnwindSafe for DenseMap<K, V>
impl<K, V> Send for DenseMap<K, V>
impl<K, V> Sync for DenseMap<K, V>
impl<K, V> Unpin for DenseMap<K, V>
impl<K, V> UnsafeUnpin for DenseMap<K, V>
impl<K, V> UnwindSafe for DenseMap<K, V>
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