Struct rkyv::collections::btree_set::ArchivedBTreeSet
source · pub struct ArchivedBTreeSet<K>(/* private fields */);
Expand description
An archived BTreeSet
. This is a wrapper around a B-tree map with the same key and a value of
()
.
Implementations§
source§impl<K> ArchivedBTreeSet<K>
impl<K> ArchivedBTreeSet<K>
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 set contains a value for the specified key.
The key may be any borrowed form of the set’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, value: &Q) -> Option<&K>
pub fn get<Q: Ord + ?Sized>(&self, value: &Q) -> Option<&K>
Returns a reference to the value int he set, if any, that is equal to the given value.
The value may be any borrowed form of the set’s value type, but the ordering on the borrowed form must match the ordering on the value type.
sourcepub fn iter(&self) -> Keys<'_, K, ()> ⓘ
pub fn iter(&self) -> Keys<'_, K, ()> ⓘ
Gets an iterator over the keys of the set, in sorted order.
sourcepub unsafe fn resolve_from_len(
len: usize,
pos: usize,
resolver: BTreeSetResolver,
out: *mut Self,
)
pub unsafe fn resolve_from_len( len: usize, pos: usize, resolver: BTreeSetResolver, out: *mut Self, )
Resolves a B-tree set 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 set
source§impl<K> ArchivedBTreeSet<K>
impl<K> ArchivedBTreeSet<K>
sourcepub unsafe fn serialize_from_reverse_iter<'a, UK, S, I>(
iter: I,
serializer: &mut S,
) -> Result<BTreeSetResolver, S::Error>where
UK: 'a + Serialize<S, Archived = K>,
S: Serializer + ?Sized,
I: ExactSizeIterator<Item = &'a UK>,
pub unsafe fn serialize_from_reverse_iter<'a, UK, S, I>(
iter: I,
serializer: &mut S,
) -> Result<BTreeSetResolver, S::Error>where
UK: 'a + Serialize<S, Archived = K>,
S: Serializer + ?Sized,
I: ExactSizeIterator<Item = &'a UK>,
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: Debug> Debug for ArchivedBTreeSet<K>
impl<K: Debug> Debug for ArchivedBTreeSet<K>
source§impl<K, D> Deserialize<BTreeSet<K>, D> for ArchivedBTreeSet<K::Archived>
impl<K, D> Deserialize<BTreeSet<K>, D> for ArchivedBTreeSet<K::Archived>
source§impl<K: Hash> Hash for ArchivedBTreeSet<K>
impl<K: Hash> Hash for ArchivedBTreeSet<K>
source§impl<'a, K> IntoIterator for &'a ArchivedBTreeSet<K>
impl<'a, K> IntoIterator for &'a ArchivedBTreeSet<K>
source§impl<K: Ord> Ord for ArchivedBTreeSet<K>
impl<K: Ord> Ord for ArchivedBTreeSet<K>
source§fn cmp(&self, other: &ArchivedBTreeSet<K>) -> Ordering
fn cmp(&self, other: &ArchivedBTreeSet<K>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<K, AK: PartialEq<K>> PartialEq<ArchivedBTreeSet<AK>> for BTreeSet<K>
impl<K, AK: PartialEq<K>> PartialEq<ArchivedBTreeSet<AK>> for BTreeSet<K>
source§fn eq(&self, other: &ArchivedBTreeSet<AK>) -> bool
fn eq(&self, other: &ArchivedBTreeSet<AK>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<K, AK: PartialEq<K>> PartialEq<BTreeSet<K>> for ArchivedBTreeSet<AK>
impl<K, AK: PartialEq<K>> PartialEq<BTreeSet<K>> for ArchivedBTreeSet<AK>
source§impl<K: PartialEq> PartialEq for ArchivedBTreeSet<K>
impl<K: PartialEq> PartialEq for ArchivedBTreeSet<K>
source§fn eq(&self, other: &ArchivedBTreeSet<K>) -> bool
fn eq(&self, other: &ArchivedBTreeSet<K>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<K: PartialOrd> PartialOrd for ArchivedBTreeSet<K>
impl<K: PartialOrd> PartialOrd for ArchivedBTreeSet<K>
source§fn partial_cmp(&self, other: &ArchivedBTreeSet<K>) -> Option<Ordering>
fn partial_cmp(&self, other: &ArchivedBTreeSet<K>) -> Option<Ordering>
1.0.0 · source§fn 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 moreimpl<K: Eq> Eq for ArchivedBTreeSet<K>
impl<K> StructuralPartialEq for ArchivedBTreeSet<K>
Auto Trait Implementations§
impl<K> Freeze for ArchivedBTreeSet<K>
impl<K> RefUnwindSafe for ArchivedBTreeSet<K>where
K: RefUnwindSafe,
impl<K> Send for ArchivedBTreeSet<K>where
K: Send,
impl<K> Sync for ArchivedBTreeSet<K>where
K: Sync,
impl<K> !Unpin for ArchivedBTreeSet<K>
impl<K> UnwindSafe for ArchivedBTreeSet<K>where
K: UnwindSafe,
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§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