Struct rkyv_test::collections::btree_map::ArchivedBTreeMap
source · [−]pub struct ArchivedBTreeMap<K, V> { /* private fields */ }
Expand description
An archived BTreeMap
.
Implementations
sourceimpl<K, V> ArchivedBTreeMap<K, V>
impl<K, V> ArchivedBTreeMap<K, V>
sourcepub fn contains_key<Q: Ord + ?Sized>(&self, key: &Q) -> bool where
K: Borrow<Q> + Ord,
pub fn contains_key<Q: Ord + ?Sized>(&self, key: &Q) -> bool where
K: Borrow<Q> + Ord,
Returns true
if the map contains a value for the specified key.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
sourcepub fn get<Q: Ord + ?Sized>(&self, key: &Q) -> Option<&V> where
K: Borrow<Q> + Ord,
pub fn get<Q: Ord + ?Sized>(&self, key: &Q) -> Option<&V> where
K: Borrow<Q> + Ord,
Returns a reference to the value corresponding to the key.
The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
sourcepub fn get_key_value<Q: Ord + ?Sized>(&self, k: &Q) -> Option<(&K, &V)> where
K: Borrow<Q> + Ord,
pub fn get_key_value<Q: Ord + ?Sized>(&self, k: &Q) -> Option<(&K, &V)> where
K: Borrow<Q> + Ord,
Returns the key-value pair corresponding to the supplied key.
The supplied key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
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 entries of the map, sorted by key.
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 of the map, in sorted order.
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 of the map, in order by key.
sourcepub unsafe fn resolve_from_len(
len: usize,
pos: usize,
resolver: BTreeMapResolver,
out: *mut Self
)
pub unsafe fn resolve_from_len(
len: usize,
pos: usize,
resolver: BTreeMapResolver,
out: *mut Self
)
Resolves a B-tree map from its length.
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 B-tree map
Trait Implementations
sourceimpl<K, V, C> CheckBytes<C> for ArchivedBTreeMap<K, V> where
K: CheckBytes<C> + Ord,
V: CheckBytes<C>,
C: ArchiveContext + ?Sized,
C::Error: Error,
impl<K, V, C> CheckBytes<C> for ArchivedBTreeMap<K, V> where
K: CheckBytes<C> + Ord,
V: CheckBytes<C>,
C: ArchiveContext + ?Sized,
C::Error: Error,
type Error = ArchivedBTreeMapError<<K as CheckBytes<C>>::Error, <V as CheckBytes<C>>::Error, <C as Fallible>::Error>
type Error = ArchivedBTreeMapError<<K as CheckBytes<C>>::Error, <V as CheckBytes<C>>::Error, <C as Fallible>::Error>
The error that may result from checking the type.
sourceunsafe fn check_bytes<'a>(
value: *const Self,
context: &mut C
) -> Result<&'a Self, Self::Error>
unsafe fn check_bytes<'a>(
value: *const Self,
context: &mut C
) -> Result<&'a Self, Self::Error>
Checks whether the given pointer points to a valid value within the given context. Read more
sourceimpl<K: Debug, V: Debug> Debug for ArchivedBTreeMap<K, V>
impl<K: Debug, V: Debug> Debug for ArchivedBTreeMap<K, V>
sourceimpl<K: Archive + Ord, V: Archive, D: Fallible + ?Sized> Deserialize<BTreeMap<K, V, Global>, D> for ArchivedBTreeMap<K::Archived, V::Archived> where
K::Archived: Deserialize<K, D> + Ord,
V::Archived: Deserialize<V, D>,
impl<K: Archive + Ord, V: Archive, D: Fallible + ?Sized> Deserialize<BTreeMap<K, V, Global>, D> for ArchivedBTreeMap<K::Archived, V::Archived> where
K::Archived: Deserialize<K, D> + Ord,
V::Archived: Deserialize<V, D>,
sourceimpl<K: Hash, V: Hash> Hash for ArchivedBTreeMap<K, V>
impl<K: Hash, V: Hash> Hash for ArchivedBTreeMap<K, V>
sourceimpl<'a, K, V> IntoIterator for &'a ArchivedBTreeMap<K, V>
impl<'a, K, V> IntoIterator for &'a ArchivedBTreeMap<K, V>
sourceimpl<K: Ord, V: Ord> Ord for ArchivedBTreeMap<K, V>
impl<K: Ord, V: Ord> Ord for ArchivedBTreeMap<K, V>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<K, V, AK: PartialEq<K>, AV: PartialEq<V>> PartialEq<ArchivedBTreeMap<AK, AV>> for BTreeMap<K, V>
impl<K, V, AK: PartialEq<K>, AV: PartialEq<V>> PartialEq<ArchivedBTreeMap<AK, AV>> for BTreeMap<K, V>
sourcefn eq(&self, other: &ArchivedBTreeMap<AK, AV>) -> bool
fn eq(&self, other: &ArchivedBTreeMap<AK, AV>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl<K: PartialEq, V: PartialEq> PartialEq<ArchivedBTreeMap<K, V>> for ArchivedBTreeMap<K, V>
impl<K: PartialEq, V: PartialEq> PartialEq<ArchivedBTreeMap<K, V>> for ArchivedBTreeMap<K, V>
sourceimpl<K, V, AK: PartialEq<K>, AV: PartialEq<V>> PartialEq<BTreeMap<K, V, Global>> for ArchivedBTreeMap<AK, AV>
impl<K, V, AK: PartialEq<K>, AV: PartialEq<V>> PartialEq<BTreeMap<K, V, Global>> for ArchivedBTreeMap<AK, AV>
sourceimpl<K: PartialOrd, V: PartialOrd> PartialOrd<ArchivedBTreeMap<K, V>> for ArchivedBTreeMap<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd<ArchivedBTreeMap<K, V>> for ArchivedBTreeMap<K, V>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<K: Eq, V: Eq> Eq for ArchivedBTreeMap<K, V>
Auto Trait Implementations
impl<K, V> RefUnwindSafe for ArchivedBTreeMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for ArchivedBTreeMap<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for ArchivedBTreeMap<K, V> where
K: Sync,
V: Sync,
impl<K, V> !Unpin for ArchivedBTreeMap<K, V>
impl<K, V> UnwindSafe for ArchivedBTreeMap<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(
&<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.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more