AggregateState

Trait AggregateState 

Source
pub trait AggregateState: Send + Sync {
    // Required methods
    fn accumulate(&mut self, value: &DataValue) -> Result<()>;
    fn finalize(self: Box<Self>) -> DataValue;
    fn clone_box(&self) -> Box<dyn AggregateState>;
    fn reset(&mut self);
}
Expand description

State maintained during aggregation Each aggregate function manages its own state type

Required Methods§

Source

fn accumulate(&mut self, value: &DataValue) -> Result<()>

Add a value to the aggregate

Source

fn finalize(self: Box<Self>) -> DataValue

Finalize and return the aggregate result

Source

fn clone_box(&self) -> Box<dyn AggregateState>

Create a new instance of this state

Source

fn reset(&mut self)

Reset the state for reuse

Implementors§