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,

source

pub fn new( keys: Vec<K>, values: Vec<D1>, aux_values: Vec<D2> ) -> NoKeyBoomHashMap2<K, D1, D2>

source

pub fn new_parallel( keys: Vec<K>, values: Vec<D1>, aux_values: Vec<D2> ) -> NoKeyBoomHashMap2<K, D1, D2>

source

pub fn new_with_mphf( mphf: Mphf<K>, values: Vec<D1>, aux_values: Vec<D2> ) -> NoKeyBoomHashMap2<K, D1, D2>

source

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.

source

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>

source§

fn clone(&self) -> NoKeyBoomHashMap2<K, D1, D2>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K: Debug, D1: Debug, D2: Debug> Debug for NoKeyBoomHashMap2<K, D1, D2>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K, D1, D2> FromIterator<(K, D1, D2)> for NoKeyBoomHashMap2<K, D1, D2>where K: ConstructibleKey, D1: Debug, D2: Debug,

source§

fn from_iter<I: IntoIterator<Item = (K, D1, D2)>>(iter: I) -> Self

Creates a value from an iterator. Read more

Auto Trait Implementations§

§

impl<K, D1, D2> RefUnwindSafe for NoKeyBoomHashMap2<K, D1, D2>where D1: RefUnwindSafe, D2: RefUnwindSafe, K: RefUnwindSafe,

§

impl<K, D1, D2> Send for NoKeyBoomHashMap2<K, D1, D2>where D1: Send, D2: Send, K: Send,

§

impl<K, D1, D2> Sync for NoKeyBoomHashMap2<K, D1, D2>where D1: Sync, D2: Sync, K: Sync,

§

impl<K, D1, D2> Unpin for NoKeyBoomHashMap2<K, D1, D2>where D1: Unpin, D2: Unpin, K: Unpin,

§

impl<K, D1, D2> UnwindSafe for NoKeyBoomHashMap2<K, D1, D2>where D1: UnwindSafe, D2: UnwindSafe, K: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.