Struct rkyv::collections::btree_set::ArchivedBTreeSet
source · #[repr(transparent)]pub struct ArchivedBTreeSet<K>(_);
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) -> boolwhere
K: Borrow<Q> + Ord,
pub fn contains_key<Q: Ord + ?Sized>(&self, key: &Q) -> boolwhere K: Borrow<Q> + Ord,
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>where
K: Borrow<Q> + Ord,
pub fn get<Q: Ord + ?Sized>(&self, value: &Q) -> Option<&K>where K: Borrow<Q> + Ord,
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<__C: ?Sized, K> CheckBytes<__C> for ArchivedBTreeSet<K>where
ArchivedBTreeMap<K, ()>: CheckBytes<__C>,
impl<__C: ?Sized, K> CheckBytes<__C> for ArchivedBTreeSet<K>where ArchivedBTreeMap<K, ()>: CheckBytes<__C>,
§type Error = TupleStructCheckError
type Error = TupleStructCheckError
The error that may result from checking the type.
source§unsafe fn check_bytes<'__bytecheck>(
value: *const Self,
context: &mut __C
) -> Result<&'__bytecheck Self, TupleStructCheckError>
unsafe fn check_bytes<'__bytecheck>( value: *const Self, context: &mut __C ) -> Result<&'__bytecheck Self, TupleStructCheckError>
Checks whether the given pointer points to a valid value within the
given context. Read more
source§impl<K: Debug> Debug for ArchivedBTreeSet<K>
impl<K: Debug> Debug for ArchivedBTreeSet<K>
source§impl<K, D> Deserialize<BTreeSet<K, Global>, D> for ArchivedBTreeSet<K::Archived>where
K: Archive + Ord,
K::Archived: Deserialize<K, D> + Ord,
D: Fallible + ?Sized,
impl<K, D> Deserialize<BTreeSet<K, Global>, D> for ArchivedBTreeSet<K::Archived>where K: Archive + Ord, K::Archived: Deserialize<K, D> + Ord, D: Fallible + ?Sized,
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: PartialEq> PartialEq<ArchivedBTreeSet<K>> for ArchivedBTreeSet<K>
impl<K: PartialEq> PartialEq<ArchivedBTreeSet<K>> 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, AK: PartialEq<K>> PartialEq<BTreeSet<K, Global>> for ArchivedBTreeSet<AK>
impl<K, AK: PartialEq<K>> PartialEq<BTreeSet<K, Global>> for ArchivedBTreeSet<AK>
source§impl<K: PartialOrd> PartialOrd<ArchivedBTreeSet<K>> for ArchivedBTreeSet<K>
impl<K: PartialOrd> PartialOrd<ArchivedBTreeSet<K>> 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> StructuralEq for ArchivedBTreeSet<K>
impl<K> StructuralPartialEq for ArchivedBTreeSet<K>
Auto Trait Implementations§
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
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.