pub struct ArchivedIndexSet<K> { /* private fields */ }
Expand description
An archived IndexSet
.
Implementations§
Source§impl<K> ArchivedIndexSet<K>
impl<K> ArchivedIndexSet<K>
Sourcepub fn get_full<Q>(&self, k: &Q) -> Option<(usize, &K)>
pub fn get_full<Q>(&self, k: &Q) -> Option<(usize, &K)>
Returns the item index and value stored in the set, if any.
Sourcepub fn get_index_of<Q>(&self, key: &Q) -> Option<usize>
pub fn get_index_of<Q>(&self, key: &Q) -> Option<usize>
Returns the index of a key if it exists in the set.
Sourcepub fn hasher(&self) -> HashBuilder
pub fn hasher(&self) -> HashBuilder
Gets the hasher for this index set.
Sourcepub fn iter(&self) -> Keys<'_, K, ()> ⓘ
pub fn iter(&self) -> Keys<'_, K, ()> ⓘ
Returns an iterator over the keys of the index set in order.
Sourcepub unsafe fn resolve_from_len(
len: usize,
pos: usize,
resolver: IndexSetResolver,
out: *mut Self,
)
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 serializedpos
must be the position ofout
within the archiveresolver
must be the result of serializing a hash map
Source§impl<K> ArchivedIndexSet<K>
impl<K> ArchivedIndexSet<K>
Sourcepub 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,
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<K: Debug> Debug for ArchivedIndexSet<K>
impl<K: Debug> Debug for ArchivedIndexSet<K>
Source§impl<K: PartialEq> PartialEq for ArchivedIndexSet<K>
impl<K: PartialEq> PartialEq for ArchivedIndexSet<K>
Auto Trait Implementations§
impl<K> Freeze for ArchivedIndexSet<K>
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> 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