pub struct CurrentStaged<F, E, C, I, H, U, const N: usize, S>where
F: Graftable,
E: Context,
U: Update,
C: Contiguous<Item = Operation<F, U>>,
I: UnorderedIndex<Value = Location<F>>,
H: Hasher,
S: Strategy,
Operation<F, U>: Codec,{ /* private fields */ }Expand description
Staged batch returned by CurrentUnmerkleized::stage, wrapping a QMDB Staged with a
reference to the parent database.
Like any speculative batch, this handle is a branch-scoped view of the shared database: it
stays valid only while every batch finalized on the database is an ancestor of this batch
(see MerkleizedBatch’s branch-validity contract).
Implementations§
Source§impl<F, E, C, I, H, U, const N: usize, S> CurrentStaged<F, E, C, I, H, U, N, S>
Read-expansion operations for the current staged batch.
impl<F, E, C, I, H, U, const N: usize, S> CurrentStaged<F, E, C, I, H, U, N, S>
Read-expansion operations for the current staged batch.
Sourcepub fn with_metadata(self, metadata: U::Value) -> Self
pub fn with_metadata(self, metadata: U::Value) -> Self
Set commit metadata included in the merkleize call, replacing any
metadata set before staging.
Sourcepub async fn expand(
self,
keys: &[&U::Key],
) -> Result<(Range<usize>, Vec<Option<U::Value>>, Self), Error<F>>
pub async fn expand( self, keys: &[&U::Key], ) -> Result<(Range<usize>, Vec<Option<U::Value>>, Self), Error<F>>
Expand this staged batch with more reads.
Existing read indices remain stable. Newly read keys are appended to the staged read set and
assigned the returned range. Expansion does not deduplicate against previously staged keys
and does not observe values computed for earlier staged slots but not yet passed to
merkleize.
Source§impl<F, E, C, I, H, K, V, const N: usize, S> CurrentStaged<F, E, C, I, H, Update<K, V>, N, S>
Staged merkleize for the current unordered update kind.
impl<F, E, C, I, H, K, V, const N: usize, S> CurrentStaged<F, E, C, I, H, Update<K, V>, N, S>
Staged merkleize for the current unordered update kind.
Sourcepub async fn merkleize(
self,
updates: Vec<(usize, Option<V::Value>)>,
upserts: Vec<(K, Option<V::Value>)>,
) -> Result<CurrentMerkleized<F, E, C, I, H, Update<K, V>, N, S>, Error<F>>
pub async fn merkleize( self, updates: Vec<(usize, Option<V::Value>)>, upserts: Vec<(K, Option<V::Value>)>, ) -> Result<CurrentMerkleized<F, E, C, I, H, Update<K, V>, N, S>, Error<F>>
Record updates for staged reads and upserts for unread keys, then merkleize.
Consumes the staged handle and write vectors. Call expand
before this method if more keys must be read into the staged index space.
A Some value is an upsert. None is a delete. Update indices refer to the staged read
set: the initial stage input followed by any expand ranges.
Metadata set via with_metadata (or before staging) is
committed with the returned batch.
§Panics
Panics if any update’s read_index is out of the staged read range.
Source§impl<F, E, C, I, H, K, V, const N: usize, S> CurrentStaged<F, E, C, I, H, Update<K, V>, N, S>
Staged merkleize for the current ordered update kind.
impl<F, E, C, I, H, K, V, const N: usize, S> CurrentStaged<F, E, C, I, H, Update<K, V>, N, S>
Staged merkleize for the current ordered update kind.
Sourcepub async fn merkleize(
self,
updates: Vec<(usize, Option<V::Value>)>,
upserts: Vec<(K, Option<V::Value>)>,
) -> Result<CurrentMerkleized<F, E, C, I, H, Update<K, V>, N, S>, Error<F>>
pub async fn merkleize( self, updates: Vec<(usize, Option<V::Value>)>, upserts: Vec<(K, Option<V::Value>)>, ) -> Result<CurrentMerkleized<F, E, C, I, H, Update<K, V>, N, S>, Error<F>>
Record updates for staged reads and upserts for unread keys, then merkleize.
Consumes the staged handle and write vectors. Call expand
before this method if more keys must be read into the staged index space.
A Some value is an upsert. None is a delete. Update indices refer to the staged read
set: the initial stage input followed by any expand ranges.
Metadata set via with_metadata (or before staging) is
committed with the returned batch.
§Panics
Panics if any update’s read_index is out of the staged read range.
Auto Trait Implementations§
impl<F, E, C, I, H, U, const N: usize, S> !RefUnwindSafe for CurrentStaged<F, E, C, I, H, U, N, S>
impl<F, E, C, I, H, U, const N: usize, S> !UnwindSafe for CurrentStaged<F, E, C, I, H, U, N, S>
impl<F, E, C, I, H, U, const N: usize, S> Freeze for CurrentStaged<F, E, C, I, H, U, N, S>
impl<F, E, C, I, H, U, const N: usize, S> Send for CurrentStaged<F, E, C, I, H, U, N, S>
impl<F, E, C, I, H, U, const N: usize, S> Sync for CurrentStaged<F, E, C, I, H, U, N, S>
impl<F, E, C, I, H, U, const N: usize, S> Unpin for CurrentStaged<F, E, C, I, H, U, N, S>
impl<F, E, C, I, H, U, const N: usize, S> UnsafeUnpin for CurrentStaged<F, E, C, I, H, U, N, S>where
Operation<F, U>: Sized,
Staged<F, H, U, N, S>: UnsafeUnpin,
Shared<Db<F, E, C, I, H, U, N, S>>: UnsafeUnpin,
Option<<U as Update>::Value>: UnsafeUnpin,
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> 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