[−][src]Trait bm_le::Construct
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.
Required methods
fn intermediate_of(
left: &Value<Self::Intermediate, Self::End>,
right: &Value<Self::Intermediate, Self::End>
) -> Self::Intermediate
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>,
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())
.
Implementors
impl<D, T> Construct for InheritedDigestConstruct<D, T> where
D: Digest,
T: Clone + Default + AsRef<[u8]>,
[src]
D: Digest,
T: Clone + Default + AsRef<[u8]>,
type Intermediate = GenericArray<u8, <D as Digest>::OutputSize>
type End = T
fn intermediate_of(
left: &Value<<InheritedDigestConstruct<D, T> as Construct>::Intermediate, <InheritedDigestConstruct<D, T> as Construct>::End>,
right: &Value<<InheritedDigestConstruct<D, T> as Construct>::Intermediate, <InheritedDigestConstruct<D, T> as Construct>::End>
) -> <InheritedDigestConstruct<D, T> as Construct>::Intermediate
[src]
left: &Value<<InheritedDigestConstruct<D, T> as Construct>::Intermediate, <InheritedDigestConstruct<D, T> as Construct>::End>,
right: &Value<<InheritedDigestConstruct<D, T> as Construct>::Intermediate, <InheritedDigestConstruct<D, T> as Construct>::End>
) -> <InheritedDigestConstruct<D, T> as Construct>::Intermediate
fn empty_at<DB>(
db: &mut DB,
depth_to_bottom: usize
) -> Result<Value<<InheritedDigestConstruct<D, T> as Construct>::Intermediate, <InheritedDigestConstruct<D, T> as Construct>::End>, <DB as Backend>::Error> where
DB: WriteBackend<Construct = InheritedDigestConstruct<D, T>>,
[src]
db: &mut DB,
depth_to_bottom: usize
) -> Result<Value<<InheritedDigestConstruct<D, T> as Construct>::Intermediate, <InheritedDigestConstruct<D, T> as Construct>::End>, <DB as Backend>::Error> where
DB: WriteBackend<Construct = InheritedDigestConstruct<D, T>>,
impl<D, T> Construct for UnitDigestConstruct<D, T> where
D: Digest,
T: Clone + Default + AsRef<[u8]>,
[src]
D: Digest,
T: Clone + Default + AsRef<[u8]>,
type Intermediate = GenericArray<u8, <D as Digest>::OutputSize>
type End = T
fn intermediate_of(
left: &Value<<UnitDigestConstruct<D, T> as Construct>::Intermediate, <UnitDigestConstruct<D, T> as Construct>::End>,
right: &Value<<UnitDigestConstruct<D, T> as Construct>::Intermediate, <UnitDigestConstruct<D, T> as Construct>::End>
) -> <UnitDigestConstruct<D, T> as Construct>::Intermediate
[src]
left: &Value<<UnitDigestConstruct<D, T> as Construct>::Intermediate, <UnitDigestConstruct<D, T> as Construct>::End>,
right: &Value<<UnitDigestConstruct<D, T> as Construct>::Intermediate, <UnitDigestConstruct<D, T> as Construct>::End>
) -> <UnitDigestConstruct<D, T> as Construct>::Intermediate
fn empty_at<DB>(
_db: &mut DB,
_depth_to_bottom: usize
) -> Result<Value<<UnitDigestConstruct<D, T> as Construct>::Intermediate, <UnitDigestConstruct<D, T> as Construct>::End>, <DB as Backend>::Error> where
DB: WriteBackend<Construct = UnitDigestConstruct<D, T>>,
[src]
_db: &mut DB,
_depth_to_bottom: usize
) -> Result<Value<<UnitDigestConstruct<D, T> as Construct>::Intermediate, <UnitDigestConstruct<D, T> as Construct>::End>, <DB as Backend>::Error> where
DB: WriteBackend<Construct = UnitDigestConstruct<D, T>>,
impl<D: Digest<OutputSize = U32>> Construct for DigestConstruct<D>
[src]
type Intermediate = Intermediate
type End = End
fn intermediate_of(
left: &ValueOf<Self>,
right: &ValueOf<Self>
) -> Self::Intermediate
[src]
left: &ValueOf<Self>,
right: &ValueOf<Self>
) -> Self::Intermediate
fn empty_at<DB: WriteBackend<Construct = Self>>(
db: &mut DB,
depth_to_bottom: usize
) -> Result<ValueOf<Self>, DB::Error>
[src]
db: &mut DB,
depth_to_bottom: usize
) -> Result<ValueOf<Self>, DB::Error>