Trait metrics_util::Hashable [−][src]
Expand description
A type that can hash itself.
In high-performance use cases, an object can pre-hash itself, or memoize its hash value, when it
is anticipated that an object will be hashed multiple times. Rather than the standard library
Hash
trait, Hashable
exposes an interface that forces objects to hash themselves entirely,
providing only the resulting 8-byte hash.
For all implementations of Hashable
, you must utilize metrics::KeyHasher
. Usage of
another hasher will lead to inconsistency in places where Hashable
is used, specifically
Registry
. You can wrap items in DefaultHashable
to ensure they utilize the correct hasher.