Skip to main content

PushOperator

Trait PushOperator 

Source
pub trait PushOperator: Send + Sync {
    // Required methods
    fn push(
        &mut self,
        chunk: DataChunk,
        sink: &mut dyn Sink,
    ) -> Result<bool, OperatorError>;
    fn finalize(&mut self, sink: &mut dyn Sink) -> Result<(), OperatorError>;
    fn name(&self) -> &'static str;

    // Provided method
    fn preferred_chunk_size(&self) -> ChunkSizeHint { ... }
}
Expand description

Push-based operator trait.

Unlike pull-based operators that return data on next() calls, push-based operators receive data via push() and forward results to a downstream sink.

Required Methods§

Source

fn push( &mut self, chunk: DataChunk, sink: &mut dyn Sink, ) -> Result<bool, OperatorError>

Process an incoming chunk and push results to the sink.

Returns Ok(true) to continue processing, Ok(false) for early termination.

§Errors

Returns Err if the operator or sink fails during processing.

Source

fn finalize(&mut self, sink: &mut dyn Sink) -> Result<(), OperatorError>

Called when all input has been processed.

Pipeline breakers (Sort, Aggregate, etc.) emit their results here.

§Errors

Returns Err if finalization or downstream sink consumption fails.

Source

fn name(&self) -> &'static str

Name of this operator for debugging.

Provided Methods§

Source

fn preferred_chunk_size(&self) -> ChunkSizeHint

Hint for preferred chunk size.

Implementors§