pub struct BinaryMerkleTree<D> {
pub log_len: usize,
pub inner_nodes: Vec<D>,
}
Expand description
A binary Merkle tree that commits batches of vectors.
The vector entries at each index in a batch are hashed together into leaf digests. Then a Merkle tree is constructed over the leaf digests. The implementation requires that the vector lengths are all equal to each other and a power of two.
Fields§
§log_len: usize
Base-2 logarithm of the number of leaves
inner_nodes: Vec<D>
The inner nodes, arranged as a flattened array of layers with the root at the end
Implementations§
Trait Implementations§
Source§impl<D: Clone> Clone for BinaryMerkleTree<D>
impl<D: Clone> Clone for BinaryMerkleTree<D>
Source§fn clone(&self) -> BinaryMerkleTree<D>
fn clone(&self) -> BinaryMerkleTree<D>
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 moreAuto Trait Implementations§
impl<D> Freeze for BinaryMerkleTree<D>
impl<D> RefUnwindSafe for BinaryMerkleTree<D>where
D: RefUnwindSafe,
impl<D> Send for BinaryMerkleTree<D>where
D: Send,
impl<D> Sync for BinaryMerkleTree<D>where
D: Sync,
impl<D> Unpin for BinaryMerkleTree<D>where
D: Unpin,
impl<D> UnwindSafe for BinaryMerkleTree<D>where
D: UnwindSafe,
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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