pub struct FPHash2<GS: GroupSize = TwoToPowerBits, SS: SeedSize = TwoToPowerBitsStatic<2>, S = BuildDefaultSeededHasher> { /* private fields */ }Expand description
Fingerprinting-based minimal perfect hash function with group optimization (FMPHGO).
See:
- P. Beling, Fingerprinting-based minimal perfect hashing revisited
Implementations
sourceimpl<GS: GroupSize + Sync, SS: SeedSize, S: BuildSeededHasher + Sync> FPHash2<GS, SS, S>
impl<GS: GroupSize + Sync, SS: SeedSize, S: BuildSeededHasher + Sync> FPHash2<GS, SS, S>
sourcepub fn get_stats<K: Hash, A: AccessStatsCollector>(
&self,
key: &K,
access_stats: &mut A
) -> Option<u64>
pub fn get_stats<K: Hash, A: AccessStatsCollector>(
&self,
key: &K,
access_stats: &mut A
) -> Option<u64>
Gets the value associated with the given key and reports statistics to access_stats.
sourcepub fn get<K: Hash>(&self, key: &K) -> Option<u64>
pub fn get<K: Hash>(&self, key: &K) -> Option<u64>
Gets the value associated with the given key.
sourcepub fn with_conf_stats<K, KS, BS>(
keys: KS,
conf: FPHash2Conf<GS, SS, S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
KS: KeySet<K> + Sync,
BS: BuildStatsCollector,
pub fn with_conf_stats<K, KS, BS>(
keys: KS,
conf: FPHash2Conf<GS, SS, S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
KS: KeySet<K> + Sync,
BS: BuildStatsCollector,
Builds FPHash2 for given keys, using the configuration conf and reporting statistics to stats.
pub fn with_conf<K, KS>(keys: KS, conf: FPHash2Conf<GS, SS, S>) -> Self where
K: Hash + Sync,
KS: KeySet<K> + Sync,
sourcepub fn from_slice_with_conf_stats<K, BS>(
keys: &[K],
conf: FPHash2Conf<GS, SS, S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
pub fn from_slice_with_conf_stats<K, BS>(
keys: &[K],
conf: FPHash2Conf<GS, SS, S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
Builds FPHash2 for given keys, using the configuration conf.
sourcepub fn from_slice_with_conf<K>(keys: &[K], conf: FPHash2Conf<GS, SS, S>) -> Self where
K: Hash + Sync,
pub fn from_slice_with_conf<K>(keys: &[K], conf: FPHash2Conf<GS, SS, S>) -> Self where
K: Hash + Sync,
Builds FPHash2 for given keys, using the configuration conf.
sourcepub fn from_slice_mut_with_conf_stats<K, BS>(
keys: &mut [K],
conf: FPHash2Conf<GS, SS, S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
pub fn from_slice_mut_with_conf_stats<K, BS>(
keys: &mut [K],
conf: FPHash2Conf<GS, SS, S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
Builds FPHash2 for given keys, using the configuration conf.
sourcepub fn from_slice_mut_with_conf<K>(
keys: &mut [K],
conf: FPHash2Conf<GS, SS, S>
) -> Self where
K: Hash + Sync,
pub fn from_slice_mut_with_conf<K>(
keys: &mut [K],
conf: FPHash2Conf<GS, SS, S>
) -> Self where
K: Hash + Sync,
Builds FPHash2 for given keys, using the configuration conf.
sourcepub fn write_bytes(&self) -> usize
pub fn write_bytes(&self) -> usize
Returns number of bytes which write will write.
sourcepub fn read_with_hasher(input: &mut dyn Read, hasher: S) -> Result<Self>
pub fn read_with_hasher(input: &mut dyn Read, hasher: S) -> Result<Self>
Reads Self from the input. Hasher must be the same as the one used to write.
pub fn level_sizes(&self) -> &[u32]
sourceimpl FPHash2
impl FPHash2
sourcepub fn from_slice_with_stats<K, BS>(keys: &[K], stats: &mut BS) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
pub fn from_slice_with_stats<K, BS>(keys: &[K], stats: &mut BS) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
Builds FPHash2 for given keys, reporting statistics to stats.
sourcepub fn from_slice<K: Hash + Sync>(keys: &[K]) -> Self
pub fn from_slice<K: Hash + Sync>(keys: &[K]) -> Self
Builds FPHash2 for given keys.
Trait Implementations
sourceimpl<GS: GroupSize, SS: SeedSize, S: BuildSeededHasher> GetSize for FPHash2<GS, SS, S>
impl<GS: GroupSize, SS: SeedSize, S: BuildSeededHasher> GetSize for FPHash2<GS, SS, S>
sourcefn size_bytes_dyn(&self) -> usize
fn size_bytes_dyn(&self) -> usize
Returns approximate number of bytes occupied by dynamic (heap) part of self.
Same as self.size_bytes() - std::mem::size_of_val(self). Read more
sourceconst USES_DYN_MEM: bool = true
const USES_DYN_MEM: bool = true
true if and only if the variables of this type can use dynamic (heap) memory.
sourcefn size_bytes(&self) -> usize
fn size_bytes(&self) -> usize
Returns approximate, total (including heap memory) number of bytes occupied by self.
Auto Trait Implementations
impl<GS, SS, S> RefUnwindSafe for FPHash2<GS, SS, S> where
GS: RefUnwindSafe,
S: RefUnwindSafe,
SS: RefUnwindSafe,
<SS as SeedSize>::VecElement: RefUnwindSafe,
impl<GS, SS, S> Send for FPHash2<GS, SS, S> where
GS: Send,
S: Send,
SS: Send,
impl<GS, SS, S> Sync for FPHash2<GS, SS, S> where
GS: Sync,
S: Sync,
impl<GS, SS, S> Unpin for FPHash2<GS, SS, S> where
GS: Unpin,
S: Unpin,
SS: Unpin,
impl<GS, SS, S> UnwindSafe for FPHash2<GS, SS, S> where
GS: UnwindSafe,
S: UnwindSafe,
SS: UnwindSafe,
<SS as SeedSize>::VecElement: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more