[][src]Struct boomphf::Mphf

pub struct Mphf<T> { /* fields omitted */ }

A minimal perfect hash function over a set of objects of type T.

Methods

impl<'a, T: 'a + Hash + Clone + Debug> Mphf<T>
[src]

Constructs an MPHF from a (possibly lazy) iterator over iterators. This allows construction of very large MPHFs without holding all the keys in memory simultaneously. objects is an IntoInterator yielding a stream of IntoIterators that must not contain any duplicate items. objects must be able to be iterated over multiple times and yield the same stream of items each time. gamma controls the tradeoff between the construction-time and run-time speed, and the size of the datastructure representing the hash function. See the paper for details. max_iters - None to never stop trying to find a perfect hash (safe if no duplicates). NOTE: the inner iterator N::IntoIter should override nth if there's an efficient way to skip over items when iterating. This is important because later iterations of the MPHF construction algorithm skip most of the items.

impl<T: Hash + Clone + Debug> Mphf<T>
[src]

Generate a minimal perfect hash function for the set of objects. objects must not contain any duplicate items. gamma controls the tradeoff between the construction-time and run-time speed, and the size of the datastructure representing the hash function. See the paper for details. max_iters - None to never stop trying to find a perfect hash (safe if no duplicates).

Compute the hash value of item. This method should only be used with items known to be in construction set. Use try_hash if you cannot guarantee that item was in the construction set. If item was not present in the construction set this function may panic.

Compute the hash value of item. If item was not present in the set of objects used to construct the hash function, the return value will an arbitrary value Some(x), or None.

impl<T: Hash + Clone + Debug + Sync + Send> Mphf<T>
[src]

Same as new, but parallelizes work on the rayon default Rayon threadpool. Configure the number of threads on that threadpool to control CPU usage.

impl<'a, T: 'a + Hash + Clone + Debug + Send + Sync> Mphf<T>
[src]

Same as to from_chunked_iterator but parallelizes work over num_threads threads.

Trait Implementations

impl<T: Debug> Debug for Mphf<T>
[src]

Auto Trait Implementations

impl<T> Send for Mphf<T> where
    T: Send

impl<T> Sync for Mphf<T> where
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]