Skip to main content

ArchivedBTreeSet

Struct ArchivedBTreeSet 

Source
pub struct ArchivedBTreeSet<K, const E: usize = 5>(/* 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, const E: usize> ArchivedBTreeSet<K, E>

Source

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

Returns an iterator over the items of the archived B-tree set.

Source§

impl<K, const E: usize> ArchivedBTreeSet<K, E>

Source

pub fn contains_key<Q: Ord + ?Sized>(&self, key: &Q) -> bool
where 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 in the 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 len(&self) -> usize

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

Source

pub fn resolve_from_len( len: usize, resolver: BTreeSetResolver, out: Place<Self>, )

Resolves a B-tree set from its length.

Source

pub fn serialize_from_ordered_iter<I, KU, S>( iter: I, serializer: &mut S, ) -> Result<BTreeSetResolver, S::Error>
where I: ExactSizeIterator, I::Item: Borrow<KU>, KU: Serialize<S, Archived = K>, S: Fallible + Allocator + Writer + ?Sized, S::Error: Source,

Serializes an ArchivedBTreeSet from the given iterator and serializer.

Source

pub fn visit<T>(&self, f: impl FnMut(&K) -> ControlFlow<T>) -> Option<T>

Visits every key in the B-tree with a function.

If f returns ControlFlow::Break, visit will return Some with the broken value. If f returns Continue for every key in the tree, visit will return None.

Trait Implementations§

Source§

impl<K, const E: usize, __C: Fallible + ?Sized> CheckBytes<__C> for ArchivedBTreeSet<K, E>
where <__C as Fallible>::Error: Trace, ArchivedBTreeMap<K, (), E>: CheckBytes<__C>,

Source§

unsafe fn check_bytes( value: *const Self, context: &mut __C, ) -> Result<(), <__C as Fallible>::Error>

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

impl<K, const E: usize> Debug for ArchivedBTreeSet<K, E>
where K: Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<K, D> Deserialize<BTreeSet<K>, 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, AK: PartialEq<K>> PartialEq<BTreeSet<K>> for ArchivedBTreeSet<AK>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<K, const E: usize> Portable for ArchivedBTreeSet<K, E>

Auto Trait Implementations§

§

impl<K, const E: usize> Freeze for ArchivedBTreeSet<K, E>

§

impl<K, const E: usize> RefUnwindSafe for ArchivedBTreeSet<K, E>
where K: RefUnwindSafe,

§

impl<K, const E: usize> Send for ArchivedBTreeSet<K, E>
where K: Send,

§

impl<K, const E: usize> Sync for ArchivedBTreeSet<K, E>
where K: Sync,

§

impl<K, const E: usize = 5> !Unpin for ArchivedBTreeSet<K, E>

§

impl<K, const E: usize = 5> !UnsafeUnpin for ArchivedBTreeSet<K, E>

§

impl<K, const E: usize> UnwindSafe for ArchivedBTreeSet<K, E>
where K: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

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 T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.