pub trait Aggregator: Send + Sync {
// Required methods
fn accumulate(&mut self, value: Option<&Value>);
fn finalize(&self) -> Value;
fn reset(&mut self);
fn new_instance(&self) -> Box<dyn Aggregator>;
fn name(&self) -> &'static str;
}Expand description
Trait for aggregation functions
Required Methods§
Sourcefn accumulate(&mut self, value: Option<&Value>)
fn accumulate(&mut self, value: Option<&Value>)
Process a single value
Sourcefn new_instance(&self) -> Box<dyn Aggregator>
fn new_instance(&self) -> Box<dyn Aggregator>
Create a fresh copy for a new group