Struct snarkvm_algorithms::merkle_tree::merkle_tree::MerkleTree
source · [−]pub struct MerkleTree<P: MerkleParameters> { /* private fields */ }
Implementations
sourceimpl<P: MerkleParameters + Send + Sync> MerkleTree<P>
impl<P: MerkleParameters + Send + Sync> MerkleTree<P>
pub const DEPTH: usize
pub fn new<L: ToBytes + Send + Sync>(
parameters: Arc<P>,
leaves: &[L]
) -> Result<Self, MerkleError>
pub fn rebuild<L: ToBytes + Send + Sync>(
&self,
start_index: usize,
new_leaves: &[L]
) -> Result<Self, MerkleError>
pub fn root(&self) -> &<P::H as CRH>::Output
pub fn tree(&self) -> &[<P::H as CRH>::Output]
pub fn hashed_leaves(&self) -> &[<P::H as CRH>::Output]
pub fn generate_proof<L: ToBytes>(
&self,
index: usize,
leaf: &L
) -> Result<MerklePath<P>, MerkleError>
Trait Implementations
sourceimpl<P: Default + MerkleParameters> Default for MerkleTree<P>
impl<P: Default + MerkleParameters> Default for MerkleTree<P>
sourcefn default() -> MerkleTree<P>
fn default() -> MerkleTree<P>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<P> RefUnwindSafe for MerkleTree<P> where
P: RefUnwindSafe,
<<P as MerkleParameters>::H as CRH>::Output: RefUnwindSafe,
impl<P> Send for MerkleTree<P>
impl<P> Sync for MerkleTree<P>
impl<P> Unpin for MerkleTree<P> where
<<P as MerkleParameters>::H as CRH>::Output: Unpin,
impl<P> UnwindSafe for MerkleTree<P> where
P: RefUnwindSafe,
<<P as MerkleParameters>::H as CRH>::Output: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more