Hashable

Trait Hashable 

Source
pub trait Hashable: Debug {
    // Required methods
    fn empty_leaf() -> Self;
    fn combine(level: Level, a: &Self, b: &Self) -> Self;

    // Provided method
    fn empty_root(level: Level) -> Self
       where Self: Sized { ... }
}
Expand description

A trait describing the operations that make a type suitable for use as a leaf or node value in a merkle tree.

Required Methods§

Source

fn empty_leaf() -> Self

Source

fn combine(level: Level, a: &Self, b: &Self) -> Self

Combines two provided nodes that both exist at the specified level of the tree, producing a new node at level level + 1.

Provided Methods§

Source

fn empty_root(level: Level) -> Self
where Self: Sized,

Produces an empty root at the specified level of the tree by combining empty leaf values.

At each successive level, the value is produced by combining the value at the level below with a copy of itself.

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.

Implementors§