Skip to main content

NewMerkleHasherForTreeSize

Trait NewMerkleHasherForTreeSize 

Source
pub trait NewMerkleHasherForTreeSize: Sized {
    // Required method
    fn new_for_tree_size(num_leaves: u64) -> Self;
}
Expand description

Creates hashers for trees with a known number of leaves.

A hasher either ignores the tree size, in which case it implements Default and gets this trait through the blanket implementation, or depends on it, in which case it implements this trait directly and must not implement Default. It can’t be both: the two implementations would conflict.

Required Methods§

Source

fn new_for_tree_size(num_leaves: u64) -> Self

Create a hasher for a tree with num_leaves leaves

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<H> NewMerkleHasherForTreeSize for H
where H: Default,

Hashers that implement Default ignore the tree size