pub trait BatchProcessor {
type Config;
type Error: Error;
type Batch<'a>
where Self: 'a;
// Required methods
fn new(config: Self::Config, schema: SchemaRef) -> Self;
fn process<'a>(
&'a mut self,
rows: &[Row],
) -> Result<Self::Batch<'a>, Self::Error>;
fn flush(&mut self) -> Result<Option<RecordBatch>, Self::Error>;
}Expand description
A batch processor that transforms input rows into Arrow RecordBatches.
Uses GATs to allow flexible lifetime relationships between the processor and the batches it produces.
Required Associated Types§
Required Methods§
Sourcefn new(config: Self::Config, schema: SchemaRef) -> Self
fn new(config: Self::Config, schema: SchemaRef) -> Self
Create a new processor with the given configuration.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.