pub struct BytesIndexMap<V> { /* private fields */ }
Expand description
An IndexMap where the keys are always u8 slices which are pre-hashed.
Implementations§
Source§impl<V> BytesIndexMap<V>
impl<V> BytesIndexMap<V>
pub fn new() -> Self
pub fn reserve(&mut self, additional: usize)
pub fn len(&self) -> IdxSize
pub fn is_empty(&self) -> bool
pub fn entry<'k>(&mut self, hash: u64, key: &'k [u8]) -> Entry<'_, 'k, V>
Sourcepub unsafe fn get_index_unchecked(&self, idx: IdxSize) -> (u64, &[u8], &V)
pub unsafe fn get_index_unchecked(&self, idx: IdxSize) -> (u64, &[u8], &V)
Gets the hash, key and value at the given index by insertion order.
§Safety
The index must be less than len().
Sourcepub fn iter_hash_keys(&self) -> impl Iterator<Item = (u64, &[u8])>
pub fn iter_hash_keys(&self) -> impl Iterator<Item = (u64, &[u8])>
Iterates over the (hash, key) pairs in insertion order.
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for BytesIndexMap<V>
impl<V> RefUnwindSafe for BytesIndexMap<V>where
V: RefUnwindSafe,
impl<V> Send for BytesIndexMap<V>where
V: Send,
impl<V> Sync for BytesIndexMap<V>where
V: Sync,
impl<V> Unpin for BytesIndexMap<V>where
V: Unpin,
impl<V> UnwindSafe for BytesIndexMap<V>where
V: UnwindSafe,
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