pub struct InputStreamState {
pub lease: StreamLease,
pub target: String,
pub columns: Vec<String>,
pub committed_rid: u64,
pub row_count: u64,
pub chunk_count: u64,
pub snapshot_lsn: u64,
}Expand description
Per-stream state for an in-flight input stream. Lives in the
session loop’s InputStreamRegistry and is mutated synchronously
as each StreamChunk is committed.
Fields§
§lease: StreamLease§target: String§columns: Vec<String>§committed_rid: u64CDC LSN at the last successful per-chunk commit; the start of
the committed RID range is the lease’s snapshot_lsn.
row_count: u64§chunk_count: u64§snapshot_lsn: u64Implementations§
Source§impl InputStreamState
impl InputStreamState
pub fn new(lease: StreamLease, target: String, columns: Vec<String>) -> Self
Sourcepub fn commit_chunk(
&mut self,
runtime: &RedDBRuntime,
rows: &[JsonValue],
) -> Result<(), (String, String)>
pub fn commit_chunk( &mut self, runtime: &RedDBRuntime, rows: &[JsonValue], ) -> Result<(), (String, String)>
Commit one chunk of rows as a single atomic multi-row INSERT.
On success the rows are durable and committed_rid advances to
the post-commit CDC LSN. On failure nothing in this chunk
commits — committed_rid (and therefore recoverable_rid)
stays at the last good commit, so chunks 1..N-1 remain
durable (AC #3).
Trait Implementations§
Auto Trait Implementations§
impl Forget for InputStreamState
impl Freeze for InputStreamState
impl Move for InputStreamState
impl RefUnwindSafe for InputStreamState
impl Send for InputStreamStatewhere
RawVecInner: Send,
impl Sync for InputStreamStatewhere
RawVecInner: Sync,
impl Unpin for InputStreamState
impl UnsafeUnpin for InputStreamStatewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for InputStreamStatewhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request