pub trait AggregateFunction: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn create_state(&self) -> Box<dyn AggregateState>;
// Provided methods
fn supports_distinct(&self) -> bool { ... }
fn set_parameters(
&self,
_params: &[DataValue],
) -> Result<Box<dyn AggregateFunction>> { ... }
}
Expand description
Aggregate function trait Each aggregate function (SUM, COUNT, AVG, etc.) implements this
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Description for help system
Sourcefn create_state(&self) -> Box<dyn AggregateState>
fn create_state(&self) -> Box<dyn AggregateState>
Create initial state for this aggregate
Provided Methods§
Sourcefn supports_distinct(&self) -> bool
fn supports_distinct(&self) -> bool
Does this aggregate support DISTINCT?
Sourcefn set_parameters(
&self,
_params: &[DataValue],
) -> Result<Box<dyn AggregateFunction>>
fn set_parameters( &self, _params: &[DataValue], ) -> Result<Box<dyn AggregateFunction>>
For aggregates with parameters (like STRING_AGG separator)