pub struct CompactMerkleizedBatch<F: Family, D: Digest, K: Key, V: ValueEncoding, S: Strategy>where
Operation<F, K, V>: EncodeShared,{ /* private fields */ }Expand description
A speculative batch whose root digest has been computed.
Implementations§
Source§impl<F: Family, D: Digest, K: Key, V: ValueEncoding, S: Strategy> MerkleizedBatch<F, D, K, V, S>where
Operation<F, K, V>: EncodeShared,
impl<F: Family, D: Digest, K: Key, V: ValueEncoding, S: Strategy> MerkleizedBatch<F, D, K, V, S>where
Operation<F, K, V>: EncodeShared,
Sourcepub fn operations(&self) -> (Location<F>, Arc<Vec<Operation<F, K, V>>>)
pub fn operations(&self) -> (Location<F>, Arc<Vec<Operation<F, K, V>>>)
Return the operations this batch appends to the log and the location of the first.
Sourcepub fn proof<E, C, H>(
&self,
db: &Db<F, E, K, V, H, C, S>,
) -> Result<Proof<F, D>, Error<F>>
pub fn proof<E, C, H>( &self, db: &Db<F, E, K, V, H, C, S>, ) -> Result<Proof<F, D>, Error<F>>
Inclusion proof for the operations returned by Self::operations, anchored at
this batch’s tip. The pair verifies against Self::root via
crate::qmdb::verify_proof. Together with Self::pinned_nodes they verify via
crate::qmdb::verify_proof_and_pinned_nodes.
Nodes of unapplied ancestors are read through the chain, so those ancestors must still be
alive. Nodes below the chain are read from db’s
Merkle store, which retains them at least until this batch’s
changes are applied (applying it or a descendant prunes the store to its frontier).
§Errors
Returns crate::merkle::Error::ElementPruned if a required node has been pruned or
belongs to a dropped unapplied ancestor, and crate::merkle::Error::Empty if the batch
has no operations (a Db::to_batch snapshot).
Sourcepub fn pinned_nodes<E, C, H>(
&self,
db: &Db<F, E, K, V, H, C, S>,
) -> Result<Vec<D>, Error<F>>
pub fn pinned_nodes<E, C, H>( &self, db: &Db<F, E, K, V, H, C, S>, ) -> Result<Vec<D>, Error<F>>
The Merkle frontier at the first operation returned by Self::operations
(Family::nodes_to_pin), which lets a consumer holding only this batch’s base rebuild
compact state and replay the operations. The operations, Self::proof, and pinned
nodes verify against Self::root via crate::qmdb::verify_proof_and_pinned_nodes.
Nodes of unapplied ancestors are read through the chain, so those ancestors must still be
alive. Nodes below the chain are read from db’s
Merkle store, which retains them at least until this batch’s
changes are applied (applying it or a descendant prunes the store to its frontier).
§Errors
Returns crate::merkle::Error::ElementPruned if a required node has been pruned or
belongs to a dropped unapplied ancestor.
Sourcepub fn new_batch<H>(self: &Arc<Self>) -> UnmerkleizedBatch<F, H, K, V, S>where
H: Hasher<Digest = D>,
pub fn new_batch<H>(self: &Arc<Self>) -> UnmerkleizedBatch<F, H, K, V, S>where
H: Hasher<Digest = D>,
Create a new speculative batch with this one as its parent.
Trait Implementations§
Source§impl<F: Clone + Family, D: Clone + Digest, K: Clone + Key, V: Clone + ValueEncoding, S: Clone + Strategy> Clone for MerkleizedBatch<F, D, K, V, S>
impl<F: Clone + Family, D: Clone + Digest, K: Clone + Key, V: Clone + ValueEncoding, S: Clone + Strategy> Clone for MerkleizedBatch<F, D, K, V, S>
Source§fn clone(&self) -> MerkleizedBatch<F, D, K, V, S>
fn clone(&self) -> MerkleizedBatch<F, D, K, V, S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<F, D, K, V, S> Freeze for MerkleizedBatch<F, D, K, V, S>where
Arc<MerkleizedBatch<F, D, S>>: Freeze,
Arc<Vec<Operation<F, K, V>>>: Freeze,
Option<<V as ValueEncoding>::Value>: Freeze,
Option<Weak<MerkleizedBatch<F, D, K, V, S>>>: Freeze,
Bounds<F, D>: Freeze,
PhantomData<K>: Freeze,
impl<F, D, K, V, S> RefUnwindSafe for MerkleizedBatch<F, D, K, V, S>where
Arc<MerkleizedBatch<F, D, S>>: RefUnwindSafe,
Arc<Vec<Operation<F, K, V>>>: RefUnwindSafe,
Option<<V as ValueEncoding>::Value>: RefUnwindSafe,
Option<Weak<MerkleizedBatch<F, D, K, V, S>>>: RefUnwindSafe,
Bounds<F, D>: RefUnwindSafe,
PhantomData<K>: RefUnwindSafe,
impl<F, D, K, V, S> Send for MerkleizedBatch<F, D, K, V, S>where
Arc<MerkleizedBatch<F, D, S>>: Send,
Arc<Vec<Operation<F, K, V>>>: Send,
Option<<V as ValueEncoding>::Value>: Send,
Option<Weak<MerkleizedBatch<F, D, K, V, S>>>: Send,
Bounds<F, D>: Send,
PhantomData<K>: Send,
impl<F, D, K, V, S> Sync for MerkleizedBatch<F, D, K, V, S>where
Arc<MerkleizedBatch<F, D, S>>: Sync,
Arc<Vec<Operation<F, K, V>>>: Sync,
Option<<V as ValueEncoding>::Value>: Sync,
Option<Weak<MerkleizedBatch<F, D, K, V, S>>>: Sync,
Bounds<F, D>: Sync,
PhantomData<K>: Sync,
impl<F, D, K, V, S> Unpin for MerkleizedBatch<F, D, K, V, S>where
Arc<MerkleizedBatch<F, D, S>>: Unpin,
Arc<Vec<Operation<F, K, V>>>: Unpin,
Option<<V as ValueEncoding>::Value>: Unpin,
Option<Weak<MerkleizedBatch<F, D, K, V, S>>>: Unpin,
Bounds<F, D>: Unpin,
PhantomData<K>: Unpin,
impl<F, D, K, V, S> UnsafeUnpin for MerkleizedBatch<F, D, K, V, S>where
Arc<MerkleizedBatch<F, D, S>>: UnsafeUnpin,
Arc<Vec<Operation<F, K, V>>>: UnsafeUnpin,
Option<<V as ValueEncoding>::Value>: UnsafeUnpin,
Option<Weak<MerkleizedBatch<F, D, K, V, S>>>: UnsafeUnpin,
Bounds<F, D>: UnsafeUnpin,
PhantomData<K>: UnsafeUnpin,
impl<F, D, K, V, S> UnwindSafe for MerkleizedBatch<F, D, K, V, S>where
Arc<MerkleizedBatch<F, D, S>>: UnwindSafe,
Arc<Vec<Operation<F, K, V>>>: UnwindSafe,
Option<<V as ValueEncoding>::Value>: UnwindSafe,
Option<Weak<MerkleizedBatch<F, D, K, V, S>>>: UnwindSafe,
Bounds<F, D>: UnwindSafe,
PhantomData<K>: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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