pub trait PathHash:
Clone
+ Send
+ Sync {
type Hash: FieldTrait;
// Required method
fn hash_children(
&self,
left: &Self::Hash,
right: &Self::Hash,
) -> Result<Self::Hash>;
// Provided methods
fn hash_empty(&self) -> Result<Self::Hash> { ... }
fn hash_all_children(
&self,
child_nodes: &[(Self::Hash, Self::Hash)],
) -> Result<Vec<Self::Hash>> { ... }
}
Expand description
A trait for a Merkle path hash function.
Required Associated Types§
type Hash: FieldTrait
Required Methods§
Provided Methods§
Sourcefn hash_empty(&self) -> Result<Self::Hash>
fn hash_empty(&self) -> Result<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.