Struct rkyv::collections::btree_map::ArchivedBTreeMap
source · pub struct ArchivedBTreeMap<K, V> { /* private fields */ }
Expand description
An archived BTreeMap
.
Implementations§
source§impl<K, V> ArchivedBTreeMap<K, V>
impl<K, V> ArchivedBTreeMap<K, V>
sourcepub fn contains_key<Q: Ord + ?Sized>(&self, key: &Q) -> bool
pub fn contains_key<Q: Ord + ?Sized>(&self, key: &Q) -> bool
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>
pub fn get<Q: Ord + ?Sized>(&self, key: &Q) -> Option<&V>
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)>
pub fn get_key_value<Q: Ord + ?Sized>(&self, k: &Q) -> Option<(&K, &V)>
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> ⓘ
pub fn iter(&self) -> Iter<'_, K, V> ⓘ
Gets an iterator over the entries of the map, sorted by key.
sourcepub fn keys(&self) -> Keys<'_, K, V> ⓘ
pub fn keys(&self) -> Keys<'_, K, V> ⓘ
Gets an iterator over the keys of the map, in sorted order.
sourcepub fn values(&self) -> Values<'_, K, V> ⓘ
pub fn values(&self) -> Values<'_, K, 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
source§impl<K, V> ArchivedBTreeMap<K, V>
impl<K, V> ArchivedBTreeMap<K, V>
sourcepub unsafe fn serialize_from_reverse_iter<'a, UK, UV, S, I>(
iter: I,
serializer: &mut S,
) -> Result<BTreeMapResolver, S::Error>where
UK: 'a + Serialize<S, Archived = K>,
UV: 'a + Serialize<S, Archived = V>,
S: Serializer + ?Sized,
I: ExactSizeIterator<Item = (&'a UK, &'a UV)>,
pub unsafe fn serialize_from_reverse_iter<'a, UK, UV, S, I>(
iter: I,
serializer: &mut S,
) -> Result<BTreeMapResolver, S::Error>where
UK: 'a + Serialize<S, Archived = K>,
UV: 'a + Serialize<S, Archived = V>,
S: Serializer + ?Sized,
I: ExactSizeIterator<Item = (&'a UK, &'a UV)>,
Serializes an ordered iterator of key-value pairs as a B-tree map.
§Safety
- Keys returned by the iterator must be unique
- Keys must be in reverse sorted order from last to first
Trait Implementations§
source§impl<K: Archive + Ord, V: Archive, D: Fallible + ?Sized> Deserialize<BTreeMap<K, V>, D> for ArchivedBTreeMap<K::Archived, V::Archived>
impl<K: Archive + Ord, V: Archive, D: Fallible + ?Sized> Deserialize<BTreeMap<K, V>, D> for ArchivedBTreeMap<K::Archived, V::Archived>
source§impl<K, Q, V> Index<&Q> for ArchivedBTreeMap<K, V>
impl<K, Q, V> Index<&Q> for ArchivedBTreeMap<K, V>
source§impl<'a, K, V> IntoIterator for &'a ArchivedBTreeMap<K, V>
impl<'a, K, V> IntoIterator for &'a ArchivedBTreeMap<K, V>
source§impl<K: Ord, V: Ord> Ord for ArchivedBTreeMap<K, V>
impl<K: Ord, V: Ord> Ord for ArchivedBTreeMap<K, V>
source§impl<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>
source§fn eq(&self, other: &ArchivedBTreeMap<AK, AV>) -> bool
fn eq(&self, other: &ArchivedBTreeMap<AK, AV>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<K, V, AK: PartialEq<K>, AV: PartialEq<V>> PartialEq<BTreeMap<K, V>> for ArchivedBTreeMap<AK, AV>
impl<K, V, AK: PartialEq<K>, AV: PartialEq<V>> PartialEq<BTreeMap<K, V>> for ArchivedBTreeMap<AK, AV>
source§impl<K: PartialEq, V: PartialEq> PartialEq for ArchivedBTreeMap<K, V>
impl<K: PartialEq, V: PartialEq> PartialEq for ArchivedBTreeMap<K, V>
source§impl<K: PartialOrd, V: PartialOrd> PartialOrd for ArchivedBTreeMap<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd for ArchivedBTreeMap<K, V>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more