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§
Sourcefn accumulate(&mut self, value: &DataValue) -> Result<()>
fn accumulate(&mut self, value: &DataValue) -> Result<()>
Add a value to the aggregate
Sourcefn clone_box(&self) -> Box<dyn AggregateState>
fn clone_box(&self) -> Box<dyn AggregateState>
Create a new instance of this state