pub trait PathHash<E: Environment> {
type Hash: Clone + Default + Inject<Primitive = <Self::Primitive as PathHash>::Hash> + Eject<Primitive = <Self::Primitive as PathHash>::Hash> + Equal<Output = Boolean<E>> + Ternary<Boolean = Boolean<E>, Output = Self::Hash>;
type Primitive: PathHash;
// Required method
fn hash_children(&self, children: &[Self::Hash]) -> Self::Hash;
// Provided method
fn hash_empty<const ARITY: u8>(&self) -> Self::Hash { ... }
}
Expand description
A trait for a Merkle path hash function.
Required Associated Types§
type Hash: Clone + Default + Inject<Primitive = <Self::Primitive as PathHash>::Hash> + Eject<Primitive = <Self::Primitive as PathHash>::Hash> + Equal<Output = Boolean<E>> + Ternary<Boolean = Boolean<E>, Output = Self::Hash>
type Primitive: PathHash
Required Methods§
Sourcefn hash_children(&self, children: &[Self::Hash]) -> Self::Hash
fn hash_children(&self, children: &[Self::Hash]) -> Self::Hash
Returns the hash of the given child nodes.
Provided Methods§
Sourcefn hash_empty<const ARITY: u8>(&self) -> Self::Hash
fn hash_empty<const ARITY: u8>(&self) -> Self::Hash
Returns the empty 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.