Skip to main content

CurrentStaged

Struct CurrentStaged 

Source
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>
where F: Graftable, E: Context, U: Update, C: Contiguous<Item = Operation<F, U>>, I: UnorderedIndex<Value = Location<F>> + 'static, H: Hasher, S: Strategy, Operation<F, U>: Codec,

Read-expansion operations for the current staged batch.

Source

pub fn with_metadata(self, metadata: U::Value) -> Self

Set commit metadata included in the merkleize call, replacing any metadata set before staging.

Source

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>
where F: Graftable, E: Context, K: Key, V: ValueEncoding + 'static, C: Mutable<Item = Operation<F, Update<K, V>>>, I: UnorderedIndex<Value = Location<F>> + 'static, H: Hasher, S: Strategy, Operation<F, Update<K, V>>: Codec,

Staged merkleize for the current unordered update kind.

Source

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>
where F: Graftable, E: Context, K: Key, V: ValueEncoding + 'static, C: Mutable<Item = Operation<F, Update<K, V>>>, I: OrderedIndex<Value = Location<F>> + 'static, H: Hasher, S: Strategy, Operation<F, Update<K, V>>: Codec,

Staged merkleize for the current ordered update kind.

Source

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>
where Operation<F, U>: Sized, Staged<F, H, U, N, S>: Freeze, Shared<Db<F, E, C, I, H, U, N, S>>: Freeze, Option<<U as Update>::Value>: Freeze,

§

impl<F, E, C, I, H, U, const N: usize, S> Send for CurrentStaged<F, E, C, I, H, U, N, S>
where Operation<F, U>: Sized, Staged<F, H, U, N, S>: Send, Shared<Db<F, E, C, I, H, U, N, S>>: Send, Option<<U as Update>::Value>: Send,

§

impl<F, E, C, I, H, U, const N: usize, S> Sync for CurrentStaged<F, E, C, I, H, U, N, S>
where Operation<F, U>: Sized, Staged<F, H, U, N, S>: Sync, Shared<Db<F, E, C, I, H, U, N, S>>: Sync, Option<<U as Update>::Value>: Sync,

§

impl<F, E, C, I, H, U, const N: usize, S> Unpin for CurrentStaged<F, E, C, I, H, U, N, S>
where Operation<F, U>: Sized, Staged<F, H, U, N, S>: Unpin, Shared<Db<F, E, C, I, H, U, N, S>>: Unpin, Option<<U as Update>::Value>: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Threaded<T> for T

Source§

type Rest = ()

The outputs beyond the threaded value.
Source§

fn split(self) -> (T, ())

Splits into the threaded value and the extra outputs.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more