Skip to main content

BatchSource

Trait BatchSource 

Source
pub trait BatchSource: Send {
    // Required methods
    fn schema(&self) -> SchemaRef;
    fn next_batch(&mut self) -> Result<Option<StreamBatch>>;

    // Provided method
    fn close(&mut self) -> Result<()> { ... }
}
Expand description

Incremental batch source and stream contracts. Owned incremental reader for one logical source execution.

Required Methods§

Source

fn schema(&self) -> SchemaRef

Return the source schema known at open time.

Source

fn next_batch(&mut self) -> Result<Option<StreamBatch>>

Produce at most one reserved batch. None denotes normal end-of-stream.

Provided Methods§

Source

fn close(&mut self) -> Result<()>

Release source handles and source-owned reservations. It is called at most once.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§