pub trait BatchSource {
type Batch: Batch;
type Error;
// Required method
fn next_batch(
&mut self,
demand: BatchDemand,
context: &ExecutionContext,
) -> Result<Backpressure<BatchLease<Self::Batch>>, Self::Error>;
}Expand description
A pull source whose live workspace is governed by an ExecutionContext.
Implementations must not return a batch exceeding demand. If memory is
temporarily unavailable, they return Backpressure::Pending without
blocking or allocating an unbounded queue.
Required Associated Types§
Required Methods§
Sourcefn next_batch(
&mut self,
demand: BatchDemand,
context: &ExecutionContext,
) -> Result<Backpressure<BatchLease<Self::Batch>>, Self::Error>
fn next_batch( &mut self, demand: BatchDemand, context: &ExecutionContext, ) -> Result<Backpressure<BatchLease<Self::Batch>>, Self::Error>
Attempts to produce one bounded batch.
§Errors
Returns the source-specific failure without consuming future input that could not be represented in the result.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".