pub struct MerkleRootCalculator { /* private fields */ }
Implementations§
source§impl MerkleRootCalculator
impl MerkleRootCalculator
pub fn new() -> Self
pub fn new_with_stack(stack: Vec<Node>) -> Self
pub fn clear(&mut self)
sourcepub fn push(&mut self, data: &[u8])
pub fn push(&mut self, data: &[u8])
Push a new leaf node. Panics if the tree would be too large to compute the root for. In practice this never occurs, as you’d run out of memory first.
pub fn root(self) -> Bytes32
pub fn root_from_iterator<I: Iterator<Item = T>, T: AsRef<[u8]>>( self, iterator: I, ) -> Bytes32
pub fn stack(&self) -> &Vec<Node>
Trait Implementations§
source§impl Clone for MerkleRootCalculator
impl Clone for MerkleRootCalculator
source§fn clone(&self) -> MerkleRootCalculator
fn clone(&self) -> MerkleRootCalculator
Returns a copy 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 moresource§impl Debug for MerkleRootCalculator
impl Debug for MerkleRootCalculator
source§impl Default for MerkleRootCalculator
impl Default for MerkleRootCalculator
source§fn default() -> MerkleRootCalculator
fn default() -> MerkleRootCalculator
Returns the “default value” for a type. Read more
source§impl PartialEq for MerkleRootCalculator
impl PartialEq for MerkleRootCalculator
impl StructuralPartialEq for MerkleRootCalculator
Auto Trait Implementations§
impl Freeze for MerkleRootCalculator
impl RefUnwindSafe for MerkleRootCalculator
impl Send for MerkleRootCalculator
impl Sync for MerkleRootCalculator
impl Unpin for MerkleRootCalculator
impl UnwindSafe for MerkleRootCalculator
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)