pub struct MerkleTree { /* private fields */ }
Implementations§
Source§impl MerkleTree
impl MerkleTree
Source§impl MerkleTree
impl MerkleTree
pub fn new(algorithm: HashingAlgorithm, hash_size: u8) -> Self
pub fn add_hashes(&mut self, hashes: Vec<Vec<u8>>) -> Result<()>
pub fn add_hashes_unchecked(&mut self, hashes: Vec<Vec<u8>>) -> Result<()>
pub fn add_leaf(&mut self, leaf: &[u8])
pub fn add_hash(&mut self, hash: Vec<u8>) -> Result<()>
pub fn add_hash_unchecked(&mut self, hash: Vec<u8>)
pub fn merklize(&mut self) -> Result<()>
pub fn reset(&mut self)
pub fn get_merkle_root(&self) -> Result<Vec<u8>>
pub fn get_leaf_hash(&self, i: usize) -> Result<Vec<u8>>
pub fn merkle_proof_hash(&self, hash: Vec<u8>) -> Result<MerkleProof>
pub fn merkle_proof_index(&self, i: usize) -> Result<MerkleProof>
Trait Implementations§
Source§impl Clone for MerkleTree
impl Clone for MerkleTree
Source§fn clone(&self) -> MerkleTree
fn clone(&self) -> MerkleTree
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for MerkleTree
impl RefUnwindSafe for MerkleTree
impl Send for MerkleTree
impl Sync for MerkleTree
impl Unpin for MerkleTree
impl UnwindSafe for MerkleTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more