pub trait LeafHashCollector {
type Output;
// Required methods
fn add_leaf_hash(&mut self, hash: Hash);
fn complete(self, root: Hash) -> Self::Output;
}Expand description
A trait for collecting the leaf hashes of a merkle tree while constructing a merkle root.
Required Associated Types§
Sourcetype Output
type Output
The output type of MerkleRootBuilder::complete. This allows for complete to return
just the merkle root with NoopLeafHashCollector and also return the leaf hashes when a
real LeafHashCollector is used.
Required Methods§
Sourcefn add_leaf_hash(&mut self, hash: Hash)
fn add_leaf_hash(&mut self, hash: Hash)
This method is called as each leaf hash in the merkle tree is created.
If the merkle tree consists of just a root node then this method will be called for the root node.