pub struct MerkleProof<H, L> {
    pub root: H,
    pub proof: Vec<H>,
    pub number_of_leaves: usize,
    pub leaf_index: usize,
    pub leaf: L,
}
Expand description

A generated merkle proof.

The structure contains all necessary data to later on verify the proof and the leaf itself.

Fields§

§root: H

Root hash of generated merkle tree.

§proof: Vec<H>

Proof items (does not contain the leaf hash, nor the root obviously).

This vec contains all inner node hashes necessary to reconstruct the root hash given the leaf hash.

§number_of_leaves: usize

Number of leaves in the original tree.

This is needed to detect a case where we have an odd number of leaves that “get promoted” to upper layers.

§leaf_index: usize

Index of the leaf the proof is for (0-based).

§leaf: L

Leaf content.

Trait Implementations§

source§

impl<H: Debug, L: Debug> Debug for MerkleProof<H, L>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<H: PartialEq, L: PartialEq> PartialEq<MerkleProof<H, L>> for MerkleProof<H, L>

source§

fn eq(&self, other: &MerkleProof<H, L>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<H: Eq, L: Eq> Eq for MerkleProof<H, L>

source§

impl<H, L> StructuralEq for MerkleProof<H, L>

source§

impl<H, L> StructuralPartialEq for MerkleProof<H, L>

Auto Trait Implementations§

§

impl<H, L> RefUnwindSafe for MerkleProof<H, L>where H: RefUnwindSafe, L: RefUnwindSafe,

§

impl<H, L> Send for MerkleProof<H, L>where H: Send, L: Send,

§

impl<H, L> Sync for MerkleProof<H, L>where H: Sync, L: Sync,

§

impl<H, L> Unpin for MerkleProof<H, L>where H: Unpin, L: Unpin,

§

impl<H, L> UnwindSafe for MerkleProof<H, L>where H: UnwindSafe, L: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> MaybeDebug for Twhere T: Debug,