Struct boomphf::hashmap::NoKeyBoomHashMap2
source · pub struct NoKeyBoomHashMap2<K, D1, D2> {
pub mphf: Mphf<K>,
pub values: Vec<D1>,
pub aux_values: Vec<D2>,
}
Expand description
A HashMap data structure where the mapping between keys and values is encoded in a Mphf. Keys are not stored - this can greatly improve the memory consumption, but can only be used if you can guarantee that you will only query for keys that were in the original set. Querying for a new key will return a random value, silently.
Fields§
§mphf: Mphf<K>
§values: Vec<D1>
§aux_values: Vec<D2>
Implementations§
source§impl<K, D1, D2> NoKeyBoomHashMap2<K, D1, D2>where
K: ConstructibleKey,
D1: Debug,
D2: Debug,
impl<K, D1, D2> NoKeyBoomHashMap2<K, D1, D2>where K: ConstructibleKey, D1: Debug, D2: Debug,
pub fn new( keys: Vec<K>, values: Vec<D1>, aux_values: Vec<D2> ) -> NoKeyBoomHashMap2<K, D1, D2>
pub fn new_parallel( keys: Vec<K>, values: Vec<D1>, aux_values: Vec<D2> ) -> NoKeyBoomHashMap2<K, D1, D2>
pub fn new_with_mphf( mphf: Mphf<K>, values: Vec<D1>, aux_values: Vec<D2> ) -> NoKeyBoomHashMap2<K, D1, D2>
sourcepub fn get<Q>(&self, kmer: &Q) -> Option<(&D1, &D2)>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn get<Q>(&self, kmer: &Q) -> Option<(&D1, &D2)>where K: Borrow<Q>, Q: Hash + Eq + ?Sized,
Get the value associated with key
. You must use a key that was supplied during the creation of the BoomHashMap. Querying for a new key will yield Some
with a random value, or None
. Querying with a valid key will always return Some
.
sourcepub fn get_mut<Q>(&mut self, kmer: &Q) -> Option<(&mut D1, &mut D2)>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn get_mut<Q>(&mut self, kmer: &Q) -> Option<(&mut D1, &mut D2)>where K: Borrow<Q>, Q: Hash + Eq + ?Sized,
Mutably get the value associated with key
. You must use a key that was supplied during the creation of the BoomHashMap. Querying for a new key will yield Some
with a random value, or None
. Querying with a valid key will always return Some
.
Trait Implementations§
source§impl<K: Clone, D1: Clone, D2: Clone> Clone for NoKeyBoomHashMap2<K, D1, D2>
impl<K: Clone, D1: Clone, D2: Clone> Clone for NoKeyBoomHashMap2<K, D1, D2>
source§fn clone(&self) -> NoKeyBoomHashMap2<K, D1, D2>
fn clone(&self) -> NoKeyBoomHashMap2<K, D1, D2>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more