Struct pthash::SinglePhf

source ·
pub struct SinglePhf<M: Minimality, H: Hasher, E: Encoder> { /* private fields */ }
Expand description

Non-partitioned minimal perfect-hash function

This is a binding for pthash::single_phf<H, dictionary_dictionary, true>

Implementations§

source§

impl<M: Minimality, H: Hasher, E: Encoder> SinglePhf<M, H, E>

source

pub fn new() -> Self

Trait Implementations§

source§

impl<M: Minimality, H: Hasher, E: Encoder> Phf for SinglePhf<M, H, E>

source§

const MINIMAL: bool = M::AS_BOOL

Whether instances of this function have their values in the range [0; num_keys).
source§

fn build_in_internal_memory_from_bytes<Keys: IntoIterator>( &mut self, keys: Keys, config: &BuildConfiguration ) -> Result<BuildTimings, Exception>

Builds the function from a set of keys Read more
source§

fn hash(&self, key: impl Hashable) -> u64

Returns the hash of the given key Read more
source§

fn num_bits(&self) -> usize

Returns the number of bits needed to represent this perfect-hash function
source§

fn num_keys(&self) -> u64

Returns the number of keys used to build this perfect-hash function
source§

fn table_size(&self) -> u64

Largest value returned by Self::hash plus 1
source§

fn save(&mut self, path: impl AsRef<Path>) -> Result<usize, Exception>

Dump this function to disk
source§

fn load(path: impl AsRef<Path>) -> Result<Self, Exception>

Load this function from disk
source§

impl<M: Minimality, H: Hasher, E: Encoder> Send for SinglePhf<M, H, E>

source§

impl<M: Minimality, H: Hasher, E: Encoder> Sync for SinglePhf<M, H, E>

Auto Trait Implementations§

§

impl<M, H, E> RefUnwindSafe for SinglePhf<M, H, E>
where H: RefUnwindSafe, <M as SealedMinimality>::SinglePhfBackend<<H as Hasher>::Hash, E>: RefUnwindSafe,

§

impl<M, H, E> Unpin for SinglePhf<M, H, E>
where H: Unpin,

§

impl<M, H, E> UnwindSafe for SinglePhf<M, H, E>
where H: UnwindSafe, <M as SealedMinimality>::SinglePhfBackend<<H as Hasher>::Hash, E>: 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> 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, 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V