Trait merkle_tree_stream::HashMethods
source · pub trait HashMethods {
type Node: Node;
type Hash;
fn leaf(&self, leaf: &PartialNode, roots: &[Rc<Self::Node>]) -> Self::Hash;
fn parent(&self, a: &Self::Node, b: &Self::Node) -> Self::Hash;
fn node(&self, partial_node: &PartialNode, hash: Self::Hash) -> Self::Node;
}
Expand description
Functions that need to be implemented for MerkleTreeStream
.
Required Associated Types
Required Methods
sourcefn leaf(&self, leaf: &PartialNode, roots: &[Rc<Self::Node>]) -> Self::Hash
fn leaf(&self, leaf: &PartialNode, roots: &[Rc<Self::Node>]) -> Self::Hash
Pass data through a hash function.
sourcefn parent(&self, a: &Self::Node, b: &Self::Node) -> Self::Hash
fn parent(&self, a: &Self::Node, b: &Self::Node) -> Self::Hash
Pass hashes through a hash function.
sourcefn node(&self, partial_node: &PartialNode, hash: Self::Hash) -> Self::Node
fn node(&self, partial_node: &PartialNode, hash: Self::Hash) -> Self::Node
Combine a PartialNode
and a Hash
to a Node
type.