Skip to main content

BatchSource

Trait BatchSource 

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

Source

type Batch: Batch

Batch representation produced by this source.

Source

type Error

Format, I/O, or computation error produced by this source.

Required Methods§

Source

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".

Implementations on Foreign Types§

Source§

impl<S> BatchSource for MmcifBatchSource<S>
where S: SourceBytes,

Source§

impl<S> BatchSource for PdbBatchSource<S>
where S: SourceBytes,

Implementors§