pub struct ArchivedIndexMap<K, V> { /* private fields */ }
Expand description
An archived IndexMap
.
Implementations§
Source§impl<K, V> ArchivedIndexMap<K, V>
impl<K, V> ArchivedIndexMap<K, V>
Sourcepub fn contains_key<Q>(&self, k: &Q) -> bool
pub fn contains_key<Q>(&self, k: &Q) -> bool
Returns whether a key is present in the hash map.
Sourcepub fn get_full<Q>(&self, k: &Q) -> Option<(usize, &K, &V)>
pub fn get_full<Q>(&self, k: &Q) -> Option<(usize, &K, &V)>
Gets the index, key, and value associated with the given key.
Sourcepub fn get_index_of<Q>(&self, key: &Q) -> Option<usize>
pub fn get_index_of<Q>(&self, key: &Q) -> Option<usize>
Gets the index of a key if it exists in the map.
Sourcepub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>
pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>
Gets the key-value pair associated with the given key.
Sourcepub fn hasher(&self) -> HashBuilder
pub fn hasher(&self) -> HashBuilder
Gets the hasher for this index map.
Sourcepub fn iter(&self) -> Iter<'_, K, V> ⓘ
pub fn iter(&self) -> Iter<'_, K, V> ⓘ
Returns an iterator over the key-value pairs of the map in order
Sourcepub fn values(&self) -> Values<'_, K, V> ⓘ
pub fn values(&self) -> Values<'_, K, V> ⓘ
Returns an iterator over the values of the map in order.
Sourcepub unsafe fn resolve_from_len(
len: usize,
pos: usize,
resolver: IndexMapResolver,
out: *mut Self,
)
pub unsafe fn resolve_from_len( len: usize, pos: usize, resolver: IndexMapResolver, out: *mut Self, )
Resolves an archived index map from a given length and parameters.
§Safety
len
must be the number of elements that were serializedpos
must be the position ofout
within the archiveresolver
must be the result of serializing a hash map
Source§impl<K, V> ArchivedIndexMap<K, V>
impl<K, V> ArchivedIndexMap<K, V>
Sourcepub unsafe fn serialize_from_iter_index<'a, UK, UV, I, F, S>(
iter: I,
index: F,
serializer: &mut S,
) -> Result<IndexMapResolver, S::Error>where
UK: 'a + Serialize<S, Archived = K> + Hash + Eq,
UV: 'a + Serialize<S, Archived = V>,
I: Clone + ExactSizeIterator<Item = (&'a UK, &'a UV)>,
F: Fn(&UK) -> usize,
S: Serializer + ScratchSpace + ?Sized,
pub unsafe fn serialize_from_iter_index<'a, UK, UV, I, F, S>(
iter: I,
index: F,
serializer: &mut S,
) -> Result<IndexMapResolver, S::Error>where
UK: 'a + Serialize<S, Archived = K> + Hash + Eq,
UV: 'a + Serialize<S, Archived = V>,
I: Clone + ExactSizeIterator<Item = (&'a UK, &'a UV)>,
F: Fn(&UK) -> usize,
S: Serializer + ScratchSpace + ?Sized,
Serializes an iterator of key-value pairs as an index map.
§Safety
- The keys returned by the iterator must be unique
- The index function must return the index of the given key within the iterator
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for ArchivedIndexMap<K, V>
impl<K, V> RefUnwindSafe for ArchivedIndexMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for ArchivedIndexMap<K, V>
impl<K, V> Sync for ArchivedIndexMap<K, V>
impl<K, V> !Unpin for ArchivedIndexMap<K, V>
impl<K, V> UnwindSafe for ArchivedIndexMap<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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