Skip to main content

I64Map

Struct I64Map 

Source
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>

Source

pub fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn capacity(&self) -> usize

Source

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.

Source

pub fn insert(&mut self, key: i64, value: V) -> Option<V>

Source

pub fn get(&self, key: i64) -> Option<&V>

Source

pub fn get_mut(&mut self, key: i64) -> Option<&mut V>

Source

pub fn contains_key(&self, key: i64) -> bool

Source

pub fn remove(&mut self, key: i64) -> Option<V>

Source

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.

Source

pub fn clear(&mut self)

Source

pub fn iter(&self) -> impl Iterator<Item = (i64, &V)>

Source

pub fn keys(&self) -> impl Iterator<Item = i64> + '_

Source

pub fn values(&self) -> impl Iterator<Item = &V>

Source

pub fn iter_mut(&mut self) -> impl Iterator<Item = (i64, &mut V)>

Source

pub fn retain<F>(&mut self, f: F)
where F: FnMut(i64, &mut V) -> bool,

Retains only the elements specified by the predicate.

In other words, remove all entries (k, v) where f(k, &mut v) returns false.

Source

pub fn drain(&mut self) -> Drain<V>

Drains all entries from the map, returning an iterator over them

Source

pub fn entry(&mut self, key: i64) -> Entry<'_, V>

Trait Implementations§

Source§

impl<V: Clone> Clone for I64Map<V>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<V> Default for I64Map<V>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<V> Drop for I64Map<V>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<V> IntoIterator for I64Map<V>

Source§

type Item = (i64, V)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<V>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<V> Freeze for I64Map<V>
where Box<[Slot<V>]>: Freeze, Option<V>: Freeze,

§

impl<V> RefUnwindSafe for I64Map<V>
where Box<[Slot<V>]>: RefUnwindSafe, Option<V>: RefUnwindSafe,

§

impl<V> Send for I64Map<V>
where Box<[Slot<V>]>: Send, Option<V>: Send,

§

impl<V> Sync for I64Map<V>
where Box<[Slot<V>]>: Sync, Option<V>: Sync,

§

impl<V> Unpin for I64Map<V>
where Box<[Slot<V>]>: Unpin, Option<V>: Unpin,

§

impl<V> UnsafeUnpin for I64Map<V>
where Box<[Slot<V>]>: UnsafeUnpin, Option<V>: UnsafeUnpin,

§

impl<V> UnwindSafe for I64Map<V>
where Box<[Slot<V>]>: UnwindSafe, Option<V>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CompactArcDrop for T

Source§

unsafe fn drop_and_dealloc(ptr: *mut u8)

Drop the contained data and deallocate the header+data allocation. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V