Skip to main content

ArchivedHashTable

Struct ArchivedHashTable 

Source
pub struct ArchivedHashTable<T> { /* private fields */ }
Expand description

A low-level archived SwissTable hash table with explicit hashing.

Implementations§

Source§

impl<T> ArchivedHashTable<T>

Source

pub fn get_with<C>(&self, hash: u64, cmp: C) -> Option<&T>
where C: Fn(&T) -> bool,

Returns the key-value pair corresponding to the supplied key.

Source

pub fn get_seal_with<C>( this: Seal<'_, Self>, hash: u64, cmp: C, ) -> Option<Seal<'_, T>>
where C: Fn(&T) -> bool,

Returns the mutable key-value pair corresponding to the supplied key.

Source

pub const fn is_empty(&self) -> bool

Returns whether the hash table is empty.

Source

pub const fn len(&self) -> usize

Returns the number of elements in the hash table.

Source

pub fn capacity(&self) -> usize

Returns the total capacity of the hash table.

Source

pub fn raw_iter(&self) -> RawIter<T>

Returns an iterator over the entry pointers in the hash table.

Source

pub fn raw_iter_seal(this: Seal<'_, Self>) -> RawIter<T>

Returns a sealed iterator over the entry pointers in the hash table.

Source

pub fn serialize_from_iter<I, U, H, S>( items: I, hashes: H, load_factor: (usize, usize), serializer: &mut S, ) -> Result<HashTableResolver, S::Error>
where I: Clone + ExactSizeIterator, I::Item: Borrow<U>, U: Serialize<S, Archived = T>, H: ExactSizeIterator<Item = u64>, S: Fallible + Writer + Allocator + ?Sized, S::Error: Source,

Serializes an iterator of items as a hash table.

Source

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

Resolves an archived hash table from a given length and parameters.

Trait Implementations§

Source§

impl<T, __C: Fallible + ?Sized> CheckBytes<__C> for ArchivedHashTable<T>

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<C, T> Verify<C> for ArchivedHashTable<T>
where C: Fallible + ArchiveContext + ?Sized, C::Error: Source, T: CheckBytes<C>,

Source§

fn verify(&self, context: &mut C) -> Result<(), C::Error>

Checks whether the invariants of this type are upheld by self.
Source§

impl<T> Portable for ArchivedHashTable<T>

Auto Trait Implementations§

§

impl<T> Freeze for ArchivedHashTable<T>

§

impl<T> RefUnwindSafe for ArchivedHashTable<T>
where T: RefUnwindSafe,

§

impl<T> Send for ArchivedHashTable<T>
where T: Send,

§

impl<T> Sync for ArchivedHashTable<T>
where T: Sync,

§

impl<T> !Unpin for ArchivedHashTable<T>

§

impl<T> !UnsafeUnpin for ArchivedHashTable<T>

§

impl<T> UnwindSafe for ArchivedHashTable<T>
where T: 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.