pub struct Mphf<const B: usize = 32, const S: usize = 8, ST: PrimInt + Unsigned = u8, H: Hasher + Default = WyHash> { /* private fields */ }Expand description
A Minimal Perfect Hash Function (MPHF).
Template parameters:
B: group size in bits in [1..64] range, default 32 bits.S: defines maximum seed value to try (2^S) in [0..16] range, default 8.ST: seed type (unsigned integer), defaultu8.H: hasher used to hash keys, defaultWyHash.
Implementations§
Source§impl<const B: usize, const S: usize, ST: PrimInt + Unsigned, H: Hasher + Default> Mphf<B, S, ST, H>
impl<const B: usize, const S: usize, ST: PrimInt + Unsigned, H: Hasher + Default> Mphf<B, S, ST, H>
Sourcepub fn from_slice<K: Hash>(keys: &[K], gamma: f32) -> Result<Self, MphfError>
pub fn from_slice<K: Hash>(keys: &[K], gamma: f32) -> Result<Self, MphfError>
Initializes Mphf using slice of keys and parameter gamma.
Trait Implementations§
Auto Trait Implementations§
impl<const B: usize, const S: usize, ST, H> Freeze for Mphf<B, S, ST, H>
impl<const B: usize, const S: usize, ST, H> RefUnwindSafe for Mphf<B, S, ST, H>where
H: RefUnwindSafe,
ST: RefUnwindSafe,
impl<const B: usize, const S: usize, ST, H> Send for Mphf<B, S, ST, H>
impl<const B: usize, const S: usize, ST, H> Sync for Mphf<B, S, ST, H>
impl<const B: usize, const S: usize, ST, H> Unpin for Mphf<B, S, ST, H>where
H: Unpin,
impl<const B: usize, const S: usize, ST, H> UnwindSafe for Mphf<B, S, ST, H>where
H: UnwindSafe,
ST: UnwindSafe,
Blanket Implementations§
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