pub struct I64Map<V> { /* private fields */ }Expand description
High-performance HashMap for i64 keys.
Supports the full i64 key domain. i64::MIN is stored out of band so the
hot open-addressed table can continue using it as its empty-slot sentinel.
Implementations§
Source§impl<V> I64Map<V>
impl<V> I64Map<V>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> usize
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more elements to be inserted
in the map. The collection may reserve more space to avoid frequent reallocations.
pub fn insert(&mut self, key: i64, value: V) -> Option<V>
pub fn get(&self, key: i64) -> Option<&V>
pub fn get_mut(&mut self, key: i64) -> Option<&mut V>
pub fn contains_key(&self, key: i64) -> bool
pub fn remove(&mut self, key: i64) -> Option<V>
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrink the map to fit its current contents, releasing excess memory.
Call this after removing many entries to reclaim memory.
pub fn clear(&mut self)
pub fn iter(&self) -> impl Iterator<Item = (i64, &V)>
pub fn keys(&self) -> impl Iterator<Item = i64> + '_
pub fn values(&self) -> impl Iterator<Item = &V>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (i64, &mut V)>
Sourcepub fn retain<F>(&mut self, f: F)
pub fn retain<F>(&mut self, f: F)
Retains only the elements specified by the predicate.
In other words, remove all entries (k, v) where f(k, &mut v) returns false.
Sourcepub fn drain(&mut self) -> Drain<V> ⓘ
pub fn drain(&mut self) -> Drain<V> ⓘ
Drains all entries from the map, returning an iterator over them
pub fn entry(&mut self, key: i64) -> Entry<'_, V>
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for I64Map<V>
impl<V> RefUnwindSafe for I64Map<V>
impl<V> Send for I64Map<V>
impl<V> Sync for I64Map<V>
impl<V> Unpin for I64Map<V>
impl<V> UnsafeUnpin for I64Map<V>
impl<V> UnwindSafe for I64Map<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