pub struct ChangeStream {
pub schema: SchemaRef,
pub capability: CdcCapability,
/* private fields */
}Expand description
An incremental change feed: renderable batches delivered as they are produced, so a UI pane paints arriving changes instead of waiting for the whole scan.
Backed by a bounded channel, so a slow consumer applies backpressure to the producer rather than growing an unbounded buffer.
Fields§
§schema: SchemaRefThe renderable schema every batch carries (see change_row_schema).
capability: CdcCapabilityWhich backend produced this feed and why (see CdcCapability).
Implementations§
Source§impl ChangeStream
impl ChangeStream
Sourcepub fn channel(
schema: SchemaRef,
capability: CdcCapability,
capacity: usize,
) -> (ChangeSink, ChangeStream)
pub fn channel( schema: SchemaRef, capability: CdcCapability, capacity: usize, ) -> (ChangeSink, ChangeStream)
Create a stream/sink pair with a capacity-batch buffer.
Sourcepub fn ready(
schema: SchemaRef,
capability: CdcCapability,
batches: Vec<RecordBatch>,
) -> ChangeStream
pub fn ready( schema: SchemaRef, capability: CdcCapability, batches: Vec<RecordBatch>, ) -> ChangeStream
An already-complete feed — the batches are handed over as-is. Used by
backends whose engine materialises the whole result before returning
(Spark Connect’s collect does); the consumer still sees them arrive
batch-by-batch.
Sourcepub async fn next(&mut self) -> Option<Result<RecordBatch>>
pub async fn next(&mut self) -> Option<Result<RecordBatch>>
The next renderable batch, or None once the feed is exhausted.
Sourcepub async fn collect(self) -> Result<Vec<RecordBatch>>
pub async fn collect(self) -> Result<Vec<RecordBatch>>
Drain the whole feed (tests, benches, and any caller that genuinely wants the full window before acting).
Auto Trait Implementations§
impl Freeze for ChangeStream
impl RefUnwindSafe for ChangeStream
impl Send for ChangeStream
impl Sync for ChangeStream
impl Unpin for ChangeStream
impl UnsafeUnpin for ChangeStream
impl UnwindSafe for ChangeStream
Blanket Implementations§
impl<T> Allocation for T
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> 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