pub trait ConsistentHasher<N: Sized> {
// Required methods
fn nodes(&self) -> &[N];
fn capacity(&self) -> usize;
fn get<Q>(&self, key: &Q) -> Option<&N>
where Q: Hash + Eq + ?Sized;
}
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§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.