pub struct AssemblyHashMap { /* private fields */ }Expand description
Auto-growing u64 -> u64 map backed by fixed-capacity native tables.
The map owns its allocation. It is deliberately !Send and !Sync because
the underlying implementation is specified as single-threaded.
Implementations§
Source§impl AssemblyHashMap
impl AssemblyHashMap
Sourcepub fn with_capacity(minimum_capacity: usize) -> Result<Self, AllocError>
pub fn with_capacity(minimum_capacity: usize) -> Result<Self, AllocError>
Allocates a map able to hold at least minimum_capacity live entries.
pub fn len(&self) -> usize
pub fn capacity(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn get(&self, key: u64) -> Option<u64>
pub fn get(&self, key: u64) -> Option<u64>
Equivalent to std::collections::HashMap::get(key).copied().
pub fn contains_key(&self, key: u64) -> bool
Sourcepub fn reserve(&mut self, additional: usize) -> Result<(), AllocError>
pub fn reserve(&mut self, additional: usize) -> Result<(), AllocError>
Ensures space for at least additional more elements.
Sourcepub fn try_put(
&mut self,
key: u64,
value: u64,
) -> Result<Option<u64>, AllocError>
pub fn try_put( &mut self, key: u64, value: u64, ) -> Result<Option<u64>, AllocError>
Equivalent to HashMap::insert, growing in Rust when necessary.
Sourcepub fn put(&mut self, key: u64, value: u64) -> Option<u64>
pub fn put(&mut self, key: u64, value: u64) -> Option<u64>
Equivalent to HashMap::insert; panics if native allocation fails.
Sourcepub fn put_if_absent(&mut self, key: u64, value: u64) -> Option<u64>
pub fn put_if_absent(&mut self, key: u64, value: u64) -> Option<u64>
Inserts only when absent, using one native probe.
Returns the existing value when no insertion occurred.
Sourcepub fn get_or_insert(&mut self, key: u64, value: u64) -> u64
pub fn get_or_insert(&mut self, key: u64, value: u64) -> u64
Returns the current value, inserting value with one probe if absent.
Sourcepub fn replace(&mut self, key: u64, value: u64) -> Option<u64>
pub fn replace(&mut self, key: u64, value: u64) -> Option<u64>
Replaces an existing value without inserting a missing key.
pub fn remove(&mut self, key: u64) -> Option<u64>
pub fn clear(&mut self)
pub fn iter(&self) -> Iter<'_> ⓘ
Trait Implementations§
Source§impl Debug for AssemblyHashMap
impl Debug for AssemblyHashMap
Source§impl Default for AssemblyHashMap
impl Default for AssemblyHashMap
Source§impl Drop for AssemblyHashMap
impl Drop for AssemblyHashMap
Auto Trait Implementations§
impl !Send for AssemblyHashMap
impl !Sync for AssemblyHashMap
impl Freeze for AssemblyHashMap
impl RefUnwindSafe for AssemblyHashMap
impl Unpin for AssemblyHashMap
impl UnsafeUnpin for AssemblyHashMap
impl UnwindSafe for AssemblyHashMap
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