Struct holyhashmap::HolyHashMap
source · pub struct HolyHashMap<K, V, S = RandomState> { /* private fields */ }
Expand description
Holy hash maps, Batman! – Robin
Implementations§
source§impl<K, V, S> HolyHashMap<K, V, S>
impl<K, V, S> HolyHashMap<K, V, S>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Maxium size before the map needs to reallocate. This is not the true capacity, but rather the max load of the map.
pub fn reserve(&mut self, additional: usize)
pub fn shrink_to_fit(&mut self)
pub fn iter(&self) -> Iter<'_, K, V> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> ⓘ
pub fn keys(&self) -> Keys<'_, K, V> ⓘ
pub fn values(&self) -> Values<'_, K, V> ⓘ
pub fn indices(&self) -> Indices<'_, K, V> ⓘ
pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> ⓘ
source§impl<K, V> HolyHashMap<K, V>
impl<K, V> HolyHashMap<K, V>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> HolyHashMap<K, V, RandomState>
source§impl<K, V, S> HolyHashMap<K, V, S>where
S: BuildHasher,
impl<K, V, S> HolyHashMap<K, V, S>where
S: BuildHasher,
pub fn hasher(&self) -> &S
pub fn with_hasher(hash_builder: S) -> Self
pub fn with_capacity_and_hasher(capacity: usize, hash_builder: S) -> Self
source§impl<K, V, S> HolyHashMap<K, V, S>where
K: Eq + Hash,
S: BuildHasher,
impl<K, V, S> HolyHashMap<K, V, S>where
K: Eq + Hash,
S: BuildHasher,
sourcepub fn to_index<Q>(&self, key: &Q) -> Option<EntryIndex>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn to_index<Q>(&self, key: &Q) -> Option<EntryIndex>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
Gets the entry index of the key.
sourcepub fn from_index(&self, index: EntryIndex) -> Option<(&K, &V)>
pub fn from_index(&self, index: EntryIndex) -> Option<(&K, &V)>
Gets the entry by index.
Returns None
if the index is invalid (i.e., it is out of bounds or
points to a deleted entry).
sourcepub fn from_index_mut(&mut self, index: EntryIndex) -> Option<(&K, &mut V)>
pub fn from_index_mut(&mut self, index: EntryIndex) -> Option<(&K, &mut V)>
Gets the mutable entry by index.
Returns None
if the index is invalid (i.e., it is out of bounds or
points to a deleted entry).
pub fn contains_key<Q>(&self, key: &Q) -> boolwhere
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn get<Q>(&self, key: &Q) -> Option<&V>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn insert_full(&mut self, key: K, value: V) -> (EntryIndex, 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, key: &Q) -> Option<(K, V)>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
sourcepub fn remove_index(&mut self, index: EntryIndex) -> Option<(K, V)>
pub fn remove_index(&mut self, index: EntryIndex) -> Option<(K, V)>
Removes an entry by its index. Returns None
if the index is invalid.
Note that this may not be any faster than calling remove
or
remove_entry
. We must still calculate the hash of the key in order to
remove the entry.
pub fn entry(&mut self, key: K) -> Entry<'_, K, V>
Trait Implementations§
source§impl<K: Clone, V: Clone, S: Clone> Clone for HolyHashMap<K, V, S>
impl<K: Clone, V: Clone, S: Clone> Clone for HolyHashMap<K, V, S>
source§fn clone(&self) -> HolyHashMap<K, V, S>
fn clone(&self) -> HolyHashMap<K, V, S>
Returns a copy 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, V, S> Debug for HolyHashMap<K, V, S>where
K: Eq + Hash + Debug,
V: Debug,
S: BuildHasher,
impl<K, V, S> Debug for HolyHashMap<K, V, S>where
K: Eq + Hash + Debug,
V: Debug,
S: BuildHasher,
source§impl<K, V, S> Default for HolyHashMap<K, V, S>where
S: BuildHasher + Default,
impl<K, V, S> Default for HolyHashMap<K, V, S>where
S: BuildHasher + Default,
source§impl<'a, K, V, S> Extend<(&'a K, &'a V)> for HolyHashMap<K, V, S>where
K: Eq + Hash + Copy,
V: Copy,
S: BuildHasher,
impl<'a, K, V, S> Extend<(&'a K, &'a V)> for HolyHashMap<K, V, S>where
K: Eq + Hash + Copy,
V: Copy,
S: BuildHasher,
source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = (&'a K, &'a V)>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = (&'a K, &'a V)>,
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, S> Extend<(K, V)> for HolyHashMap<K, V, S>where
K: Eq + Hash,
S: BuildHasher,
impl<K, V, S> Extend<(K, V)> for HolyHashMap<K, V, S>where
K: Eq + Hash,
S: BuildHasher,
source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = (K, V)>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = (K, V)>,
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