Struct rkyv::collections::hash_map::ArchivedHashMap
source · [−]pub struct ArchivedHashMap<K, V> { /* private fields */ }
Expand description
An archived HashMap
.
Implementations
sourceimpl<K, V> ArchivedHashMap<K, V>
impl<K, V> ArchivedHashMap<K, V>
sourcepub fn hasher(&self) -> SeaHasher
pub fn hasher(&self) -> SeaHasher
Gets the hasher for this hashmap. The hasher for all archived hashmaps is the same for reproducibility.
sourcepub fn get_key_value<Q: ?Sized>(&self, k: &Q) -> Option<(&K, &V)> where
K: Borrow<Q>,
Q: Hash + Eq,
pub fn get_key_value<Q: ?Sized>(&self, k: &Q) -> Option<(&K, &V)> where
K: Borrow<Q>,
Q: Hash + Eq,
Finds the key-value entry for a key.
sourcepub fn get_key_value_pin<Q: ?Sized>(
self: Pin<&mut Self>,
k: &Q
) -> Option<(&K, Pin<&mut V>)> where
K: Borrow<Q>,
Q: Hash + Eq,
pub fn get_key_value_pin<Q: ?Sized>(
self: Pin<&mut Self>,
k: &Q
) -> Option<(&K, Pin<&mut V>)> where
K: Borrow<Q>,
Q: Hash + Eq,
Finds the mutable key-value entry for a key.
sourcepub fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool where
K: Borrow<Q>,
Q: Hash + Eq,
pub fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool where
K: Borrow<Q>,
Q: Hash + Eq,
Returns whether a key is present in the hash map.
sourcepub fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Hash + Eq,
pub fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Hash + Eq,
Gets the value associated with the given key.
sourcepub fn get_pin<Q: ?Sized>(self: Pin<&mut Self>, k: &Q) -> Option<Pin<&mut V>> where
K: Borrow<Q>,
Q: Hash + Eq,
pub fn get_pin<Q: ?Sized>(self: Pin<&mut Self>, k: &Q) -> Option<Pin<&mut V>> where
K: Borrow<Q>,
Q: Hash + Eq,
Gets the mutable value associated with the given key.
sourcepub fn iter(&self) -> Iter<'_, K, V>ⓘNotable traits for Iter<'a, K, V>impl<'a, K, V> Iterator for Iter<'a, K, V> type Item = (&'a K, &'a V);
pub fn iter(&self) -> Iter<'_, K, V>ⓘNotable traits for Iter<'a, K, V>impl<'a, K, V> Iterator for Iter<'a, K, V> type Item = (&'a K, &'a V);
Gets an iterator over the key-value entries in the hash map.
sourcepub fn iter_pin(self: Pin<&mut Self>) -> IterPin<'_, K, V>ⓘNotable traits for IterPin<'a, K, V>impl<'a, K, V> Iterator for IterPin<'a, K, V> type Item = (&'a K, Pin<&'a mut V>);
pub fn iter_pin(self: Pin<&mut Self>) -> IterPin<'_, K, V>ⓘNotable traits for IterPin<'a, K, V>impl<'a, K, V> Iterator for IterPin<'a, K, V> type Item = (&'a K, Pin<&'a mut V>);
Gets an iterator over the mutable key-value entries in the hash map.
sourcepub fn keys(&self) -> Keys<'_, K, V>ⓘNotable traits for Keys<'a, K, V>impl<'a, K, V> Iterator for Keys<'a, K, V> type Item = &'a K;
pub fn keys(&self) -> Keys<'_, K, V>ⓘNotable traits for Keys<'a, K, V>impl<'a, K, V> Iterator for Keys<'a, K, V> type Item = &'a K;
Gets an iterator over the keys in the hash map.
sourcepub fn values(&self) -> Values<'_, K, V>ⓘNotable traits for Values<'a, K, V>impl<'a, K, V> Iterator for Values<'a, K, V> type Item = &'a V;
pub fn values(&self) -> Values<'_, K, V>ⓘNotable traits for Values<'a, K, V>impl<'a, K, V> Iterator for Values<'a, K, V> type Item = &'a V;
Gets an iterator over the values in the hash map.
sourcepub fn values_pin(self: Pin<&mut Self>) -> ValuesPin<'_, K, V>ⓘNotable traits for ValuesPin<'a, K, V>impl<'a, K, V> Iterator for ValuesPin<'a, K, V> type Item = Pin<&'a mut V>;
pub fn values_pin(self: Pin<&mut Self>) -> ValuesPin<'_, K, V>ⓘNotable traits for ValuesPin<'a, K, V>impl<'a, K, V> Iterator for ValuesPin<'a, K, V> type Item = Pin<&'a mut V>;
Gets an iterator over the mutable values in the hash map.
sourcepub unsafe fn resolve_from_len(
len: usize,
pos: usize,
resolver: HashMapResolver,
out: *mut Self
)
pub unsafe fn resolve_from_len(
len: usize,
pos: usize,
resolver: HashMapResolver,
out: *mut Self
)
Resolves an archived hash 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
Trait Implementations
sourceimpl<K: Debug, V: Debug> Debug for ArchivedHashMap<K, V>
impl<K: Debug, V: Debug> Debug for ArchivedHashMap<K, V>
sourceimpl<K: Archive + Hash + Eq, V: Archive, D: Fallible + ?Sized, S: Default + BuildHasher> Deserialize<HashMap<K, V, S, Global>, D> for ArchivedHashMap<K::Archived, V::Archived> where
K::Archived: Deserialize<K, D> + Hash + Eq,
V::Archived: Deserialize<V, D>,
impl<K: Archive + Hash + Eq, V: Archive, D: Fallible + ?Sized, S: Default + BuildHasher> Deserialize<HashMap<K, V, S, Global>, D> for ArchivedHashMap<K::Archived, V::Archived> where
K::Archived: Deserialize<K, D> + Hash + Eq,
V::Archived: Deserialize<V, D>,
sourceimpl<K: Archive + Hash + Eq, V: Archive, D: Fallible + ?Sized, S: Default + BuildHasher> Deserialize<HashMap<K, V, S>, D> for ArchivedHashMap<K::Archived, V::Archived> where
K::Archived: Deserialize<K, D> + Hash + Eq,
V::Archived: Deserialize<V, D>,
impl<K: Archive + Hash + Eq, V: Archive, D: Fallible + ?Sized, S: Default + BuildHasher> Deserialize<HashMap<K, V, S>, D> for ArchivedHashMap<K::Archived, V::Archived> where
K::Archived: Deserialize<K, D> + Hash + Eq,
V::Archived: Deserialize<V, D>,
sourceimpl<K: Eq + Hash + Borrow<Q>, Q: Eq + Hash + ?Sized, V> Index<&'_ Q> for ArchivedHashMap<K, V>
impl<K: Eq + Hash + Borrow<Q>, Q: Eq + Hash + ?Sized, V> Index<&'_ Q> for ArchivedHashMap<K, V>
sourceimpl<K: Hash + Eq + Borrow<AK>, V, AK: Hash + Eq, AV: PartialEq<V>> PartialEq<ArchivedHashMap<AK, AV>> for HashMap<K, V>
impl<K: Hash + Eq + Borrow<AK>, V, AK: Hash + Eq, AV: PartialEq<V>> PartialEq<ArchivedHashMap<AK, AV>> for HashMap<K, V>
sourceimpl<K: Hash + Eq + Borrow<AK>, V, AK: Hash + Eq, AV: PartialEq<V>> PartialEq<ArchivedHashMap<AK, AV>> for HashMap<K, V>
impl<K: Hash + Eq + Borrow<AK>, V, AK: Hash + Eq, AV: PartialEq<V>> PartialEq<ArchivedHashMap<AK, AV>> for HashMap<K, V>
sourceimpl<K: Hash + Eq, V: PartialEq> PartialEq<ArchivedHashMap<K, V>> for ArchivedHashMap<K, V>
impl<K: Hash + Eq, V: PartialEq> PartialEq<ArchivedHashMap<K, V>> for ArchivedHashMap<K, V>
sourceimpl<K: Hash + Eq + Borrow<AK>, V, AK: Hash + Eq, AV: PartialEq<V>, S: BuildHasher> PartialEq<HashMap<K, V, S, Global>> for ArchivedHashMap<AK, AV>
impl<K: Hash + Eq + Borrow<AK>, V, AK: Hash + Eq, AV: PartialEq<V>, S: BuildHasher> PartialEq<HashMap<K, V, S, Global>> for ArchivedHashMap<AK, AV>
sourceimpl<K: Hash + Eq + Borrow<AK>, V, AK: Hash + Eq, AV: PartialEq<V>, S: BuildHasher> PartialEq<HashMap<K, V, S>> for ArchivedHashMap<AK, AV>
impl<K: Hash + Eq + Borrow<AK>, V, AK: Hash + Eq, AV: PartialEq<V>, S: BuildHasher> PartialEq<HashMap<K, V, S>> for ArchivedHashMap<AK, AV>
impl<K: Hash + Eq, V: Eq> Eq for ArchivedHashMap<K, V>
Auto Trait Implementations
impl<K, V> RefUnwindSafe for ArchivedHashMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for ArchivedHashMap<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for ArchivedHashMap<K, V> where
K: Sync,
V: Sync,
impl<K, V> !Unpin for ArchivedHashMap<K, V>
impl<K, V> UnwindSafe for ArchivedHashMap<K, V> where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
sourcefn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
fn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more