pub struct OpenAddressingMap<K, V, S> { /* private fields */ }
Expand description
The main open addressing hash map with user-chosen probing strategy.
Implementations§
Source§impl<K: Hash + Eq + Clone, V: Clone> OpenAddressingMap<K, V, RandomState>
impl<K: Hash + Eq + Clone, V: Clone> OpenAddressingMap<K, V, RandomState>
Source§impl<K: Hash + Eq + Clone, V: Clone, S: BuildHasher + Clone> OpenAddressingMap<K, V, S>
impl<K: Hash + Eq + Clone, V: Clone, S: BuildHasher + Clone> OpenAddressingMap<K, V, S>
Sourcepub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
Insert a key-value pair. Returns the old value if the key existed. If we exceed load factor or tombstone ratio, we rehash/grow.
Sourcepub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
Retrieve a mutable reference to the value for key
.
Trait Implementations§
Auto Trait Implementations§
impl<K, V, S> Freeze for OpenAddressingMap<K, V, S>where
S: Freeze,
impl<K, V, S> RefUnwindSafe for OpenAddressingMap<K, V, S>
impl<K, V, S> Send for OpenAddressingMap<K, V, S>
impl<K, V, S> Sync for OpenAddressingMap<K, V, S>
impl<K, V, S> Unpin for OpenAddressingMap<K, V, S>
impl<K, V, S> UnwindSafe for OpenAddressingMap<K, V, S>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more