Trait Hasher

Source
pub trait Hasher:
    Eq
    + Clone
    + Send
    + Sync
    + Debug
    + 'static {
    type Hash: AsRef<[u8]> + Eq + Ord + Copy + Clone + Send + Sync + Debug + Hash + Codec;

    // Required method
    fn hash(s: &[u8]) -> Self::Hash;
}
Expand description

A hasher, used for creating identifiers for blocks or units.

Required Associated Types§

Source

type Hash: AsRef<[u8]> + Eq + Ord + Copy + Clone + Send + Sync + Debug + Hash + Codec

A hash, as an identifier for a block or unit.

Required Methods§

Source

fn hash(s: &[u8]) -> Self::Hash

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.

Implementors§