pub trait NamespaceMerkleHasher<const NS_ID_SIZE: usize>: MerkleHash {
// Required methods
fn with_ignore_max_ns(ignore_max_ns: bool) -> Self;
fn ignores_max_ns(&self) -> bool;
fn hash_leaf_with_namespace(
&self,
data: &[u8],
namespace: NamespaceId<NS_ID_SIZE>,
) -> <Self as MerkleHash>::Output;
}Expand description
An extension of MerkleHash indicating that the hasher is namespace aware. This allows for the creation of
namespaced merkle trees and namespaced merkle proofs.
Required Methods§
Sourcefn with_ignore_max_ns(ignore_max_ns: bool) -> Self
fn with_ignore_max_ns(ignore_max_ns: bool) -> Self
Create a new hasher which ignores the max namespace
Sourcefn ignores_max_ns(&self) -> bool
fn ignores_max_ns(&self) -> bool
Check whether the hasher ignores the max namespace
Sourcefn hash_leaf_with_namespace(
&self,
data: &[u8],
namespace: NamespaceId<NS_ID_SIZE>,
) -> <Self as MerkleHash>::Output
fn hash_leaf_with_namespace( &self, data: &[u8], namespace: NamespaceId<NS_ID_SIZE>, ) -> <Self as MerkleHash>::Output
Hash the given data and namespace
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.