[][src]Struct zkp_merkle_tree::Tree

pub struct Tree<Container: VectorCommitment> { /* fields omitted */ }

Merkle tree

The tree will become the owner of the Container. This is necessary because when low layer-omission is implemented we need immutable access to the leaves. If shared ownership is required the Container can be an Rc<_>.

Methods

impl<Container: VectorCommitment> Tree<Container>[src]

pub fn from_leaves(leaves: Container) -> Result<Self>[src]

pub fn from_leaves_skip_layers(
    leaves: Container,
    skip_layers: usize
) -> Result<Self>
[src]

pub fn commitment(&self) -> &Commitment[src]

pub fn leaf_depth(&self) -> usize[src]

pub fn leaves(&self) -> &Container[src]

pub fn leaf(&self, index: usize) -> Container::Leaf[src]

pub fn node_hash(&self, index: Index) -> Hash[src]

pub fn open(&self, indices: &[usize]) -> Result<Proof>[src]

Trait Implementations

impl<Container: Debug + VectorCommitment> Debug for Tree<Container>[src]

Auto Trait Implementations

impl<Container> Send for Tree<Container> where
    Container: Send

impl<Container> Unpin for Tree<Container> where
    Container: Unpin

impl<Container> Sync for Tree<Container>

impl<Container> UnwindSafe for Tree<Container> where
    Container: UnwindSafe

impl<Container> RefUnwindSafe for Tree<Container> where
    Container: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,