Trait merkle_tree_stream::HashMethods [−][src]
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; }
Functions that need to be implemented for MerkleTreeStream
.
Associated Types
type Node: Node
The Node type we'll iterate over.
type Hash
The type of hash returned from the hashing functions.
Required Methods
fn leaf(&self, leaf: &PartialNode, roots: &[Rc<Self::Node>]) -> Self::Hash
Pass data through a hash function.
fn parent(&self, a: &Self::Node, b: &Self::Node) -> Self::Hash
Pass hashes through a hash function.
fn node(&self, partial_node: &PartialNode, hash: Self::Hash) -> Self::Node
Combine a PartialNode
and a Hash
to a Node
type.