pub trait MerkleLeaves {
type Leaf: CommitId<CommitmentId = MerkleHash>;
// Required method
fn merkle_leaves(&self) -> impl ExactSizeIterator<Item = &Self::Leaf>;
}
Expand description
Trait, which can be implemented for any collection type such that its
elements can be easily merklized with MerkleHash::merklize
.
Required Associated Types§
Sourcetype Leaf: CommitId<CommitmentId = MerkleHash>
type Leaf: CommitId<CommitmentId = MerkleHash>
The type of the collection element.
It must be able to produce a commitment in the form of a MerkleHash
.
Required Methods§
Sourcefn merkle_leaves(&self) -> impl ExactSizeIterator<Item = &Self::Leaf>
fn merkle_leaves(&self) -> impl ExactSizeIterator<Item = &Self::Leaf>
Get an iterator over all collection elements that have to be merklized.
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.