[][src]Trait bm::Construct

pub trait Construct: Sized {
    type Value: Clone + Default;
    fn intermediate_of(left: &Self::Value, right: &Self::Value) -> Self::Value;
fn empty_at<DB: WriteBackend<Construct = Self> + ?Sized>(
        db: &mut DB,
        depth_to_bottom: usize
    ) -> Result<Self::Value, DB::Error>; }

Construct for a merkle tree.

Associated Types

type Value: Clone + Default

Value stored in this merkle database.

Loading content...

Required methods

fn intermediate_of(left: &Self::Value, right: &Self::Value) -> Self::Value

Get the intermediate value of given left and right child.

fn empty_at<DB: WriteBackend<Construct = Self> + ?Sized>(
    db: &mut DB,
    depth_to_bottom: usize
) -> Result<Self::Value, DB::Error>

Get or create the empty value given a backend. empty_at(0) should always equal to Value::End(Default::default()).

Loading content...

Implementors

impl<D: Digest, V> Construct for InheritedDigestConstruct<D, V> where
    V: From<GenericArray<u8, D::OutputSize>> + AsRef<[u8]> + Default + Clone
[src]

type Value = V

impl<D: Digest, V> Construct for UnitDigestConstruct<D, V> where
    V: From<GenericArray<u8, D::OutputSize>> + AsRef<[u8]> + Default + Clone
[src]

type Value = V

Loading content...