[][src]Trait trie_db::Hasher

pub trait Hasher: Send + Sync {
    type Out: MaybeDebug + Send + Copy + Sync + PartialEq<Self::Out> + Eq + Clone + Default + AsRef<[u8]> + AsMut<[u8]> + Hash;
    type StdHasher: Send + Sync + Default + Hasher;

    const LENGTH: usize;

    fn hash(x: &[u8]) -> Self::Out;
}

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.

Associated Types

type Out: MaybeDebug + Send + Copy + Sync + PartialEq<Self::Out> + Eq + Clone + Default + AsRef<[u8]> + AsMut<[u8]> + Hash

The output type of the Hasher

type StdHasher: Send + Sync + Default + Hasher

What to use to build HashMaps with this Hasher

Loading content...

Associated Constants

const LENGTH: usize

The length in bytes of the Hasher output

Loading content...

Required methods

fn hash(x: &[u8]) -> Self::Out

Compute the hash of the provided slice of bytes returning the Out type of the Hasher

Loading content...

Implementors

Loading content...