[][src]Trait bm_le::Construct

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

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>(
    db: &mut DB,
    depth_to_bottom: usize
) -> Result<Self::Value, <DB as Backend>::Error> where
    DB: WriteBackend<Construct = Self> + ?Sized

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, V> Construct for InheritedDigestConstruct<D, V> where
    D: Digest,
    V: From<GenericArray<u8, <D as Digest>::OutputSize>> + AsRef<[u8]> + Default + Clone
[src]

type Value = V

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

type Value = V

Loading content...