LogData

Trait LogData 

Source
pub trait LogData<D, V>{
    // Required methods
    fn has_hash(&self, node: Node) -> bool;
    fn hash_for(&self, node: Node) -> Option<Hash<D>>;

    // Provided methods
    fn prove_inclusion(
        &self,
        leaf: Node,
        log_length: usize,
    ) -> InclusionProof<D, V> { ... }
    fn prove_consistency(
        &self,
        old_length: usize,
        new_length: usize,
    ) -> ConsistencyProof<D, V> { ... }
}
Expand description

A collection of hash data

Required Methods§

Source

fn has_hash(&self, node: Node) -> bool

Does this hash exist in the collection?

Source

fn hash_for(&self, node: Node) -> Option<Hash<D>>

Get the hash for a given node None if node does not yet exist

Provided Methods§

Source

fn prove_inclusion(&self, leaf: Node, log_length: usize) -> InclusionProof<D, V>

Construct an inclusion proof for this log

Source

fn prove_consistency( &self, old_length: usize, new_length: usize, ) -> ConsistencyProof<D, V>

Construct a consistency proof for this log

Implementors§

Source§

impl<D, V> LogData<D, V> for VecLog<D, V>