pub struct MerkleizedBatch<F: Family, D: Digest, Item: Send + Sync, S: Strategy> { /* private fields */ }Expand description
A speculative batch whose root digest has been computed, in contrast to UnmerkleizedBatch.
Implementations§
Source§impl<F: Family, D: Digest, Item: Send + Sync, S: Strategy> MerkleizedBatch<F, D, Item, S>
impl<F: Family, D: Digest, Item: Send + Sync, S: Strategy> MerkleizedBatch<F, D, Item, S>
Sourcepub fn root(
&self,
base: &Mem<F, D>,
hasher: &impl Hasher<F, Digest = D>,
inactive_peaks: usize,
) -> Result<D, Error<F>>
pub fn root( &self, base: &Mem<F, D>, hasher: &impl Hasher<F, Digest = D>, inactive_peaks: usize, ) -> Result<D, Error<F>>
Compute the root digest after this batch is applied using inactive_peaks and the bagging
carried by hasher.
This recomputes the root rather than reading a cache.
Sourcepub fn proof(
&self,
hasher: &impl Hasher<F, Digest = D>,
loc: Location<F>,
inactive_peaks: usize,
) -> Result<Proof<F, D>, Error<F>>
pub fn proof( &self, hasher: &impl Hasher<F, Digest = D>, loc: Location<F>, inactive_peaks: usize, ) -> Result<Proof<F, D>, Error<F>>
Inclusion proof for the element at loc.
Sourcepub fn range_proof(
&self,
hasher: &impl Hasher<F, Digest = D>,
range: Range<Location<F>>,
inactive_peaks: usize,
) -> Result<Proof<F, D>, Error<F>>
pub fn range_proof( &self, hasher: &impl Hasher<F, Digest = D>, range: Range<Location<F>>, inactive_peaks: usize, ) -> Result<Proof<F, D>, Error<F>>
Inclusion proof for all elements in range.
Sourcepub fn new_batch<H: Hasher<Digest = D>>(
self: &Arc<Self>,
) -> UnmerkleizedBatch<F, H, Item, S>where
Item: Encode,
pub fn new_batch<H: Hasher<Digest = D>>(
self: &Arc<Self>,
) -> UnmerkleizedBatch<F, H, Item, S>where
Item: Encode,
Create a new speculative batch of operations with this batch as its parent.
The batch becomes invalid if any ancestor is dropped before being applied, or a sibling fork has been applied.
Trait Implementations§
Source§impl<F: Clone + Family, D: Clone + Digest, Item: Clone + Send + Sync, S: Clone + Strategy> Clone for MerkleizedBatch<F, D, Item, S>
impl<F: Clone + Family, D: Clone + Digest, Item: Clone + Send + Sync, S: Clone + Strategy> Clone for MerkleizedBatch<F, D, Item, S>
Source§fn clone(&self) -> MerkleizedBatch<F, D, Item, S>
fn clone(&self) -> MerkleizedBatch<F, D, Item, S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<F: Debug + Family, D: Debug + Digest, Item: Debug + Send + Sync, S: Debug + Strategy> Debug for MerkleizedBatch<F, D, Item, S>
impl<F: Debug + Family, D: Debug + Digest, Item: Debug + Send + Sync, S: Debug + Strategy> Debug for MerkleizedBatch<F, D, Item, S>
Source§impl<F: Family, D: Digest, Item: Send + Sync, S: Strategy> Readable for MerkleizedBatch<F, D, Item, S>
impl<F: Family, D: Digest, Item: Send + Sync, S: Strategy> Readable for MerkleizedBatch<F, D, Item, S>
Auto Trait Implementations§
impl<F, D, Item, S> Freeze for MerkleizedBatch<F, D, Item, S>
impl<F, D, Item, S> RefUnwindSafe for MerkleizedBatch<F, D, Item, S>
impl<F, D, Item, S> Send for MerkleizedBatch<F, D, Item, S>
impl<F, D, Item, S> Sync for MerkleizedBatch<F, D, Item, S>
impl<F, D, Item, S> Unpin for MerkleizedBatch<F, D, Item, S>
impl<F, D, Item, S> UnsafeUnpin for MerkleizedBatch<F, D, Item, S>
impl<F, D, Item, S> UnwindSafe for MerkleizedBatch<F, D, Item, S>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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