pub trait Hash {
type Out: Copy + Eq + Debug;
// Required method
fn hash(bytes: &[u8]) -> Self::Out;
// Provided method
fn hash_pair(a: &[u8], b: &[u8]) -> Self::Out { ... }
}Expand description
Hash function abstraction.
Implementations are stateless types (typically unit structs);
hash is a pure function from bytes to a fixed-size digest.
Required Associated Types§
Required Methods§
Provided 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.