pub struct FPHash<S = BuildDefaultSeededHasher> { /* private fields */ }Expand description
Fingerprinting-based minimal perfect hash function (FMPH).
See:
- A. Limasset, G. Rizk, R. Chikhi, P. Peterlongo, Fast and Scalable Minimal Perfect Hashing for Massive Key Sets, SEA 2017
- P. Beling, Fingerprinting-based minimal perfect hashing revisited
Implementations
sourceimpl<S: BuildSeededHasher + Sync> FPHash<S>
impl<S: BuildSeededHasher + Sync> FPHash<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, BS>(
keys: impl KeySet<K>,
conf: FPHashConf<S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
pub fn with_conf_stats<K, BS>(
keys: impl KeySet<K>,
conf: FPHashConf<S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
Builds FPHash for given keys, using the configuration conf and reporting statistics to stats.
sourcepub fn with_conf<K>(keys: impl KeySet<K>, conf: FPHashConf<S>) -> Self where
K: Hash + Sync,
pub fn with_conf<K>(keys: impl KeySet<K>, conf: FPHashConf<S>) -> Self where
K: Hash + Sync,
Builds FPHash for given keys, using the configuration conf.
sourcepub fn from_slice_with_conf_stats<K, BS>(
keys: &[K],
conf: FPHashConf<S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
pub fn from_slice_with_conf_stats<K, BS>(
keys: &[K],
conf: FPHashConf<S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
Builds FPHash for given keys, using the configuration conf.
sourcepub fn from_slice_with_conf<K>(keys: &[K], conf: FPHashConf<S>) -> Self where
K: Hash + Sync,
pub fn from_slice_with_conf<K>(keys: &[K], conf: FPHashConf<S>) -> Self where
K: Hash + Sync,
Builds FPHash for given keys, using the configuration conf.
sourcepub fn from_slice_mut_with_conf_stats<K, BS>(
keys: &mut [K],
conf: FPHashConf<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: FPHashConf<S>,
stats: &mut BS
) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
Builds FPHash for given keys, using the configuration conf.
sourcepub fn from_slice_mut_with_conf<K>(keys: &mut [K], conf: FPHashConf<S>) -> Self where
K: Hash + Sync,
pub fn from_slice_mut_with_conf<K>(keys: &mut [K], conf: FPHashConf<S>) -> Self where
K: Hash + Sync,
Builds FPHash 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.
sourceimpl FPHash
impl FPHash
sourcepub fn read(input: &mut dyn Read) -> Result<Self>
pub fn read(input: &mut dyn Read) -> Result<Self>
Reads Self from the input.
Only FPHashs that use default hasher can be read by this method.
sourcepub fn with_stats<K, BS>(keys: impl KeySet<K>, stats: &mut BS) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
pub fn with_stats<K, BS>(keys: impl KeySet<K>, stats: &mut BS) -> Self where
K: Hash + Sync,
BS: BuildStatsCollector,
Builds FPHash for given keys, reporting statistics to stats.
Trait Implementations
sourceimpl<S: BuildSeededHasher> GetSize for FPHash<S>
impl<S: BuildSeededHasher> GetSize for FPHash<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<S> RefUnwindSafe for FPHash<S> where
S: RefUnwindSafe,
impl<S> Send for FPHash<S> where
S: Send,
impl<S> Sync for FPHash<S> where
S: Sync,
impl<S> Unpin for FPHash<S> where
S: Unpin,
impl<S> UnwindSafe for FPHash<S> where
S: 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