pub struct KeyHasher(/* private fields */);Use metrics-util::common::KeyHasher instead.
Expand description
Key-specific hashing algorithm.
Deprecated in favor of a no-hash based implementation in metrics-util::common::KeyHasher.
This hasher operates in two modes. When only write_u64 is called โ the path taken by
Keyโs Hash impl, which writes the pre-computed key hash
via write_u64(self.hash) โ finish returns that value verbatim, matching Hashable::hashable(&key)
and the no-op metrics_util::common::KeyHasher. When arbitrary bytes are written via write
(or any of the typed write_* methods that route through write), this hasher falls back to
hashing with rapidhash - https://github.com/hoxxep/rapidhash - preserving the previous
byte-hashing behavior for callers like metrics_util::DefaultHashable<H> in metrics-util 0.19.x.
Trait Implementationsยง
Sourceยงimpl Hasher for KeyHasher
impl Hasher for KeyHasher
1.26.0 ยท Sourceยงfn write_u128(&mut self, i: u128)
fn write_u128(&mut self, i: u128)
u128 into this hasher.1.3.0 ยท Sourceยงfn write_usize(&mut self, i: usize)
fn write_usize(&mut self, i: usize)
usize into this hasher.1.26.0 ยท Sourceยงfn write_i128(&mut self, i: i128)
fn write_i128(&mut self, i: i128)
i128 into this hasher.1.3.0 ยท Sourceยงfn write_isize(&mut self, i: isize)
fn write_isize(&mut self, i: isize)
isize into this hasher.Sourceยงfn write_length_prefix(&mut self, len: usize)
fn write_length_prefix(&mut self, len: usize)
hasher_prefixfree_extras)