Trait maglev::ConsistentHasher[][src]

pub trait ConsistentHasher<N: Sized> {
    fn nodes(&self) -> &[N];
fn capacity(&self) -> usize;
fn get<Q: ?Sized>(&self, key: &Q) -> Option<&N>
    where
        Q: Hash + Eq
; }
Expand description

Consistent hasher is a special kind of hashing such that when a hash table is resized, only K/n keys need to be remapped on average, where K is the number of keys, and n is the number of slots.

Required methods

Returns all nodes in arbitrary order.

Returns the number of slots in the lookup table.

Returns a reference to the node corresponding to the key.

Implementors