[][src]Trait bm_le::Construct

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

Construct for a merkle tree.

Associated Types

type Intermediate: Clone

Intermediate value stored in this merkle database.

type End: Clone + Default

End value stored in this merkle database.

Loading content...

Required methods

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

Get the intermediate value of given left and right child.

fn empty_at<DB>(
    db: &mut DB,
    depth_to_bottom: usize
) -> Result<Value<Self::Intermediate, Self::End>, <DB as Backend>::Error> where
    DB: WriteBackend<Construct = Self>, 

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

impl<D, T> Construct for UnitDigestConstruct<D, T> where
    D: Digest,
    T: Clone + Default + AsRef<[u8]>, 
[src]

type Intermediate = GenericArray<u8, <D as Digest>::OutputSize>

type End = T

impl<D: Digest<OutputSize = U32>> Construct for DigestConstruct<D>[src]

type Intermediate = Intermediate

type End = End

Loading content...