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<__C: ?Sized, K> CheckBytes<__C> for ArchivedBTreeSet<K>
impl<__C: ?Sized, K> CheckBytes<__C> for ArchivedBTreeSet<K>
Source§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>, 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: PartialEq> PartialEq for ArchivedBTreeSet<K>
impl<K: PartialEq> PartialEq for ArchivedBTreeSet<K>
Source§impl<K: PartialOrd> PartialOrd for ArchivedBTreeSet<K>
impl<K: PartialOrd> PartialOrd for ArchivedBTreeSet<K>
impl<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
Source§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<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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.