#[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>

source

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.

source

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.

source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

source

pub fn iter(&self) -> Keys<'_, K, ()>

Gets an iterator over the keys of the set, in sorted order.

source

pub fn len(&self) -> usize

Returns the number of items in the archived B-tree set.

source

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 serialized
  • pos must be the position of out within the archive
  • resolver must be the result of serializing a B-tree set
source§

impl<K> ArchivedBTreeSet<K>

source

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>,

§

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>

Checks whether the given pointer points to a valid value within the given context. Read more
source§

impl<K: Debug> Debug for ArchivedBTreeSet<K>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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,

source§

fn deserialize(&self, deserializer: &mut D) -> Result<BTreeSet<K>, D::Error>

Deserializes using the given deserializer
source§

impl<K: Hash> Hash for ArchivedBTreeSet<K>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a, K> IntoIterator for &'a ArchivedBTreeSet<K>

§

type Item = &'a K

The type of the elements being iterated over.
§

type IntoIter = Keys<'a, K, ()>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K: Ord> Ord for ArchivedBTreeSet<K>

source§

fn cmp(&self, other: &ArchivedBTreeSet<K>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<K, AK: PartialEq<K>> PartialEq<ArchivedBTreeSet<AK>> for BTreeSet<K>

source§

fn eq(&self, other: &ArchivedBTreeSet<AK>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K: PartialEq> PartialEq<ArchivedBTreeSet<K>> for ArchivedBTreeSet<K>

source§

fn eq(&self, other: &ArchivedBTreeSet<K>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K, AK: PartialEq<K>> PartialEq<BTreeSet<K, Global>> for ArchivedBTreeSet<AK>

source§

fn eq(&self, other: &BTreeSet<K>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K: PartialOrd> PartialOrd<ArchivedBTreeSet<K>> for ArchivedBTreeSet<K>

source§

fn partial_cmp(&self, other: &ArchivedBTreeSet<K>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<K: Eq> Eq for ArchivedBTreeSet<K>

source§

impl<K> StructuralEq for ArchivedBTreeSet<K>

source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where H: Hash + ?Sized, B: BuildHasher,

source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> LayoutRaw for T

source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.