pub struct ArchivedIndexSet<K> { /* private fields */ }
Expand description

An archived IndexSet.

Implementations§

source§

impl<K> ArchivedIndexSet<K>

source

pub fn contains<Q>(&self, k: &Q) -> bool
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Returns whether a key is present in the hash set.

source

pub fn first(&self) -> Option<&K>

Returns the first key.

source

pub fn get<Q>(&self, k: &Q) -> Option<&K>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Returns the value stored in the set, if any.

source

pub fn get_full<Q>(&self, k: &Q) -> Option<(usize, &K)>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Returns the item index and value stored in the set, if any.

source

pub fn get_index(&self, index: usize) -> Option<&K>

Gets a key by index.

source

pub fn get_index_of<Q>(&self, key: &Q) -> Option<usize>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Returns the index of a key if it exists in the set.

source

pub fn hasher(&self) -> HashBuilder

Gets the hasher for this index set.

source

pub fn is_empty(&self) -> bool

Returns whether the index set contains no values.

source

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

Returns an iterator over the keys of the index set in order.

source

pub fn last(&self) -> Option<&K>

Returns the last key.

source

pub fn len(&self) -> usize

Returns the number of elements in the index set.

source

pub unsafe fn resolve_from_len( len: usize, pos: usize, resolver: IndexSetResolver, out: *mut Self )

Resolves an archived index map from a given length and parameters.

§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 hash map
source§

impl<K> ArchivedIndexSet<K>

source

pub unsafe fn serialize_from_iter_index<'a, UK, I, F, S>( iter: I, index: F, serializer: &mut S ) -> Result<IndexSetResolver, S::Error>
where UK: 'a + Hash + Eq + Serialize<S, Archived = K>, I: Clone + ExactSizeIterator<Item = &'a UK>, F: Fn(&UK) -> usize, S: ScratchSpace + Serializer + ?Sized,

Serializes an iterator of keys as an index set.

§Safety
  • The keys returned by the iterator must be unique
  • The index function must return the index of the given key within the iterator

Trait Implementations§

source§

impl<__C: ?Sized, K> CheckBytes<__C> for ArchivedIndexSet<K>
where ArchivedIndexMap<K, ()>: CheckBytes<__C>,

§

type Error = StructCheckError

The error that may result from checking the type.
source§

unsafe fn check_bytes<'__bytecheck>( value: *const Self, context: &mut __C ) -> Result<&'__bytecheck Self, StructCheckError>

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

impl<K: Debug> Debug for ArchivedIndexSet<K>

source§

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

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

impl<K: PartialEq> PartialEq for ArchivedIndexSet<K>

source§

fn eq(&self, other: &Self) -> 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.

Auto Trait Implementations§

§

impl<K> RefUnwindSafe for ArchivedIndexSet<K>
where K: RefUnwindSafe,

§

impl<K> Send for ArchivedIndexSet<K>
where K: Send,

§

impl<K> Sync for ArchivedIndexSet<K>
where K: Sync,

§

impl<K> !Unpin for ArchivedIndexSet<K>

§

impl<K> UnwindSafe for ArchivedIndexSet<K>
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

§

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<F, W, T, D> Deserialize<With<T, W>, D> for F
where 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 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>

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 T
where 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 T
where 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.