pub trait Hasher: Sync + Send {
type Out: AsRef<[u8]> + AsMut<[u8]> + Default + MaybeDebug + Ord + PartialEq + Eq + Hash + Send + Sync + Clone + Copy;
type StdHasher: Sync + Send + Default + Hasher;
const LENGTH: usize;
// Required method
fn hash(x: &[u8]) -> Self::Out;
}
Expand description
Trait describing an object that can hash a slice of bytes. Used to abstract
other types over the hashing algorithm. Defines a single hash
method and an
Out
associated type with the necessary bounds.
Required Associated Constants§
Required Associated Types§
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.