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§
source§impl<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
) -> Selfwhere
K: Hash + Sync,
BS: BuildStatsCollector,
pub fn with_conf_stats<K, BS>(
keys: impl KeySet<K>,
conf: FPHashConf<S>,
stats: &mut BS
) -> Selfwhere
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>) -> Selfwhere
K: Hash + Sync,
pub fn with_conf<K>(keys: impl KeySet<K>, conf: FPHashConf<S>) -> Selfwhere
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
) -> Selfwhere
K: Hash + Sync,
BS: BuildStatsCollector,
pub fn from_slice_with_conf_stats<K, BS>(
keys: &[K],
conf: FPHashConf<S>,
stats: &mut BS
) -> Selfwhere
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>) -> Selfwhere
K: Hash + Sync,
pub fn from_slice_with_conf<K>(keys: &[K], conf: FPHashConf<S>) -> Selfwhere
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
) -> Selfwhere
K: Hash + Sync,
BS: BuildStatsCollector,
pub fn from_slice_mut_with_conf_stats<K, BS>(
keys: &mut [K],
conf: FPHashConf<S>,
stats: &mut BS
) -> Selfwhere
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>) -> Selfwhere
K: Hash + Sync,
pub fn from_slice_mut_with_conf<K>(keys: &mut [K], conf: FPHashConf<S>) -> Selfwhere
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.
source§impl 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) -> Selfwhere
K: Hash + Sync,
BS: BuildStatsCollector,
pub fn with_stats<K, BS>(keys: impl KeySet<K>, stats: &mut BS) -> Selfwhere
K: Hash + Sync,
BS: BuildStatsCollector,
Builds FPHash for given keys, reporting statistics to stats.
Trait Implementations§
source§impl<S: BuildSeededHasher> GetSize for FPHash<S>
impl<S: BuildSeededHasher> GetSize for FPHash<S>
source§fn size_bytes_dyn(&self) -> usize
fn size_bytes_dyn(&self) -> usize
self.
Same as self.size_bytes() - std::mem::size_of_val(self). Read moresource§fn size_bytes_content_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
self content.
It usually equals to size_bytes_dyn().
However, sometimes it is smaller by the amount of memory reserved but not yet used
(e.g., size_bytes_content_dyn() only takes into account the length of the vector and not its capacity). Read moresource§const 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.source§fn size_bytes(&self) -> usize
fn size_bytes(&self) -> usize
self.