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>
impl<K, D1, D2> NoKeyBoomHashMap2<K, D1, D2>
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)>
pub fn get<Q>(&self, kmer: &Q) -> Option<(&D1, &D2)>
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)>
pub fn get_mut<Q>(&mut self, kmer: &Q) -> Option<(&mut D1, &mut D2)>
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<K, D1, D2> FromIterator<(K, D1, D2)> for NoKeyBoomHashMap2<K, D1, D2>
impl<K, D1, D2> FromIterator<(K, D1, D2)> for NoKeyBoomHashMap2<K, D1, D2>
Source§fn from_iter<I: IntoIterator<Item = (K, D1, D2)>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = (K, D1, D2)>>(iter: I) -> Self
Auto Trait Implementations§
impl<K, D1, D2> Freeze for NoKeyBoomHashMap2<K, D1, D2>
impl<K, D1, D2> RefUnwindSafe for NoKeyBoomHashMap2<K, D1, D2>
impl<K, D1, D2> Send for NoKeyBoomHashMap2<K, D1, D2>
impl<K, D1, D2> Sync for NoKeyBoomHashMap2<K, D1, D2>
impl<K, D1, D2> Unpin for NoKeyBoomHashMap2<K, D1, D2>
impl<K, D1, D2> UnsafeUnpin for NoKeyBoomHashMap2<K, D1, D2>
impl<K, D1, D2> UnwindSafe for NoKeyBoomHashMap2<K, D1, D2>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more