pub trait BitHash {
// Required method
fn bit_hash<H: Hasher>(&self, state: &mut H);
}
Expand description
A hash implementation for types which normally wouldn’t have one, implemented using a hash of the bitwise equivalent types when needed.
If a type is BitHash
and BitEq
, then it is important that the following property holds:
k1 biteq k2 -> bithash(k1) == bithash(k2)
See the docs on Hash
for more information.
Useful for creating caches based on exact values. See the module level docs for more information.
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.