Skip to main content

ArchivedIndexMap

Struct ArchivedIndexMap 

Source
pub struct ArchivedIndexMap<K, V, H = FxHasher64> { /* private fields */ }
Expand description

An archived IndexMap.

Implementations§

Source§

impl<K, V, H> ArchivedIndexMap<K, V, H>

Source

pub const fn is_empty(&self) -> bool

Returns true if the map contains no elements.

Source

pub fn iter(&self) -> Iter<'_, K, V>

Returns an iterator over the key-value pairs of the map in order

Source

pub fn keys(&self) -> Keys<'_, K, V>

Returns an iterator over the keys of the map in order

Source

pub const fn len(&self) -> usize

Gets the number of items in the index map.

Source

pub fn values(&self) -> Values<'_, K, V>

Returns an iterator over the values of the map in order.

Source§

impl<K, V, H: Hasher + Default> ArchivedIndexMap<K, V, H>

Source

pub fn get_full_with<Q, C>(&self, key: &Q, cmp: C) -> Option<(usize, &K, &V)>
where Q: Hash + Eq + ?Sized, C: Fn(&Q, &K) -> bool,

Gets the index, key, and value corresponding to the supplied key using the given comparison function.

Source

pub fn get_full<Q>(&self, key: &Q) -> Option<(usize, &K, &V)>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Gets the index, key, and value corresponding to the supplied key.

Source

pub fn get_key_value_with<Q, C>(&self, key: &Q, cmp: C) -> Option<(&K, &V)>
where Q: Hash + Eq + ?Sized, C: Fn(&Q, &K) -> bool,

Returns the key-value pair corresponding to the supplied key using the given comparison function.

Source

pub fn get_key_value<Q>(&self, key: &Q) -> Option<(&K, &V)>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Returns the key-value pair corresponding to the supplied key.

Source

pub fn get_with<Q, C>(&self, key: &Q, cmp: C) -> Option<&V>
where Q: Hash + Eq + ?Sized, C: Fn(&Q, &K) -> bool,

Returns a reference to the value corresponding to the supplied key using the given comparison function.

Source

pub fn get<Q>(&self, key: &Q) -> Option<&V>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

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

Source

pub fn get_full_seal_with<'a, Q, C>( this: Seal<'a, Self>, key: &Q, cmp: C, ) -> Option<(usize, &'a K, Seal<'a, V>)>
where Q: Hash + Eq + ?Sized, C: Fn(&Q, &K) -> bool,

Gets the mutable index, key, and value corresponding to the supplied key using the given comparison function.

Source

pub fn get_full_seal<'a, Q>( this: Seal<'a, Self>, key: &Q, ) -> Option<(usize, &'a K, Seal<'a, V>)>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Gets the mutable index, key, and value corresponding to the supplied key.

Source

pub fn get_key_value_seal_with<'a, Q, C>( this: Seal<'a, Self>, key: &Q, cmp: C, ) -> Option<(&'a K, Seal<'a, V>)>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized, C: Fn(&Q, &K) -> bool,

Returns the mutable key-value pair corresponding to the supplied key using the given comparison function.

Source

pub fn get_key_value_seal<'a, Q>( this: Seal<'a, Self>, key: &Q, ) -> Option<(&'a K, Seal<'a, V>)>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Returns the mutable key-value pair corresponding to the supplied key.

Source

pub fn get_seal_with<'a, Q, C>( this: Seal<'a, Self>, key: &Q, cmp: C, ) -> Option<Seal<'a, V>>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized, C: Fn(&Q, &K) -> bool,

Returns a mutable reference to the value corresponding to the supplied key using the given comparison function.

Source

pub fn get_seal<'a, Q>(this: Seal<'a, Self>, key: &Q) -> Option<Seal<'a, V>>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

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

Source

pub fn contains_key<Q>(&self, key: &Q) -> bool
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Returns whether a key is present in the hash map.

Source

pub fn get_index(&self, index: usize) -> Option<(&K, &V)>

Gets a key-value pair by index.

Source

pub fn get_index_of_with<Q, C>(&self, key: &Q, cmp: C) -> Option<usize>
where Q: Hash + Eq + ?Sized, C: Fn(&Q, &K) -> bool,

Gets the index of a key if it exists in the map using the given comparison function.

Source

pub fn get_index_of<Q>(&self, key: &Q) -> Option<usize>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Gets the index of a key if it exists in the map.

Source

pub fn resolve_from_len( len: usize, load_factor: (usize, usize), resolver: IndexMapResolver, out: Place<Self>, )

Resolves an archived index map from a given length and parameters.

Source

pub fn serialize_from_iter<I, BKU, BVU, KU, VU, S>( iter: I, load_factor: (usize, usize), serializer: &mut S, ) -> Result<IndexMapResolver, S::Error>
where I: Clone + ExactSizeIterator<Item = (BKU, BVU)>, BKU: Borrow<KU>, BVU: Borrow<VU>, KU: Serialize<S, Archived = K> + Hash + Eq, VU: Serialize<S, Archived = V>, S: Fallible + Writer + Allocator + ?Sized, S::Error: Source,

Serializes an iterator of key-value pairs as an index map.

Trait Implementations§

Source§

impl<K, V, H, __C: Fallible + ?Sized> CheckBytes<__C> for ArchivedIndexMap<K, V, H>

Source§

unsafe fn check_bytes( value: *const Self, context: &mut __C, ) -> Result<(), <__C as Fallible>::Error>

Checks whether the given pointer points to a valid value within the given context. Read more
Source§

impl<K, V, H> Debug for ArchivedIndexMap<K, V, H>
where K: Debug, V: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K, V, H> PartialEq for ArchivedIndexMap<K, V, H>
where K: PartialEq, V: PartialEq,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<C, K, V, H> Verify<C> for ArchivedIndexMap<K, V, H>
where C: Fallible + ArchiveContext + ?Sized, C::Error: Source, K: CheckBytes<C>, V: CheckBytes<C>,

Source§

fn verify(&self, context: &mut C) -> Result<(), <C as Fallible>::Error>

Checks whether the invariants of this type are upheld by self.
Source§

impl<K: Eq, V: Eq, H> Eq for ArchivedIndexMap<K, V, H>

Source§

impl<K, V, H> Portable for ArchivedIndexMap<K, V, H>

Auto Trait Implementations§

§

impl<K, V, H> Freeze for ArchivedIndexMap<K, V, H>

§

impl<K, V, H> RefUnwindSafe for ArchivedIndexMap<K, V, H>

§

impl<K, V, H> Send for ArchivedIndexMap<K, V, H>
where H: Send, K: Send, V: Send,

§

impl<K, V, H> Sync for ArchivedIndexMap<K, V, H>
where H: Sync, K: Sync, V: Sync,

§

impl<K, V, H = FxHasher64> !Unpin for ArchivedIndexMap<K, V, H>

§

impl<K, V, H = FxHasher64> !UnsafeUnpin for ArchivedIndexMap<K, V, H>

§

impl<K, V, H> UnwindSafe for ArchivedIndexMap<K, V, H>
where H: UnwindSafe, K: UnwindSafe, 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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
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.