pub trait Hash:
'static
+ MaybeSerializeDeserialize
+ Debug
+ Clone
+ Eq
+ PartialEq
+ Hasher<Out = Self::Output> {
type Output: HashOutput;
// Required methods
fn ordered_trie_root(
input: Vec<Vec<u8>>,
state_version: StateVersion,
) -> Self::Output;
fn trie_root(
input: Vec<(Vec<u8>, Vec<u8>)>,
state_version: StateVersion,
) -> Self::Output;
// Provided methods
fn hash(s: &[u8]) -> Self::Output { ... }
fn hash_of<S>(s: &S) -> Self::Output
where S: Encode { ... }
}Expand description
Abstraction around hashing
Required Associated Types§
Sourcetype Output: HashOutput
type Output: HashOutput
The hash type produced.
Required Methods§
Sourcefn ordered_trie_root(
input: Vec<Vec<u8>>,
state_version: StateVersion,
) -> Self::Output
fn ordered_trie_root( input: Vec<Vec<u8>>, state_version: StateVersion, ) -> Self::Output
The ordered Patricia tree root of the given input.
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.