Struct HashMapX

Source
pub struct HashMapX<'a, K, V: 'a, S, SplitType>(/* private fields */)
where
    K: Eq + Hash + 'a,
    S: BuildHasher + 'a;
Expand description

A wrapper around a HashMap which provides access to the X portion of a Splittable24 value type

Implementations§

§

impl<'a, K, V: 'a, S, SplitType> HashMapX<'a, K, V, S, SplitType>
where K: Eq + Hash + 'a, S: BuildHasher,

pub fn iter<'b>( &'b self, ) -> Map<Iter<'b, K, V>, fn((&'b K, &'b V)) -> (&'b K, <V as Splittable24<'b, SplitType>>::X)>
where V: Splittable24<'b, SplitType>,

An iterator visiting all key-value pairs in arbitrary order. Iterator element type is (&'b K, &'b V::X).

pub fn iter_mut<'b>( &'b mut self, ) -> Map<IterMut<'b, K, V>, fn((&'b K, &'b mut V)) -> (&'b K, <V as Splittable24<'b, SplitType>>::MutX)>
where V: Splittable24<'b, SplitType>,

An iterator visiting all key-value pairs in arbitrary order. Iterator element type is (&'b K, &'b mut V::X).

pub fn capacity(&self) -> usize

Returns the number of elements the map can hold without reallocating.

This number is a lower bound; the HashMap<K, V> might be able to hold more, but is guaranteed to be able to hold at least this many.

pub fn len(&self) -> usize

Returns the number of elements in the map.

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

pub fn get<'b, Q>( &'b self, k: &Q, ) -> Option<<V as Splittable24<'b, SplitType>>::X>
where Q: Hash + Eq + ?Sized, K: Borrow<Q>, V: Splittable24<'b, SplitType>,

Returns a reference to the value corresponding to the key.

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed form must match those for the key type.

pub fn get_mut<'b, Q>( &'b mut self, k: &Q, ) -> Option<<V as Splittable24<'b, SplitType>>::MutX>
where Q: Hash + Eq + ?Sized, K: Borrow<Q>, V: Splittable24<'b, SplitType>,

Returns a mutable reference to the value corresponding to the key.

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed form must match those for the key type.

Auto Trait Implementations§

§

impl<'a, K, V, S, SplitType> Freeze for HashMapX<'a, K, V, S, SplitType>

§

impl<'a, K, V, S, SplitType> RefUnwindSafe for HashMapX<'a, K, V, S, SplitType>

§

impl<'a, K, V, S, SplitType> Send for HashMapX<'a, K, V, S, SplitType>
where SplitType: Send, S: Send, K: Send, V: Send,

§

impl<'a, K, V, S, SplitType> Sync for HashMapX<'a, K, V, S, SplitType>
where SplitType: Sync, S: Sync, K: Sync, V: Sync,

§

impl<'a, K, V, S, SplitType> Unpin for HashMapX<'a, K, V, S, SplitType>
where SplitType: Unpin,

§

impl<'a, K, V, S, SplitType> !UnwindSafe for HashMapX<'a, K, V, S, SplitType>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.