pub trait AggregateFn<R: GridRow>:
Send
+ Sync
+ 'static {
// Required method
fn aggregate(
&self,
column: R::Column,
rows: &mut dyn Iterator<Item = &R>,
) -> OwnedValue;
// Provided methods
fn combine(&self, _parts: &[&OwnedValue]) -> Option<OwnedValue> { ... }
fn depends_on(&self, column: R::Column) -> ColumnSet { ... }
fn name(&self) -> &str { ... }
}Expand description
A custom aggregate for Aggregate::Custom: a weighted average, a
median. Called in the background, from several threads of a large
rebuild, once per group.
Required Methods§
Provided Methods§
Sourcefn combine(&self, _parts: &[&OwnedValue]) -> Option<OwnedValue>
fn combine(&self, _parts: &[&OwnedValue]) -> Option<OwnedValue>
The aggregate of a group from its subgroups’ aggregates, when the
function allows it (a sum does, a median does not). None, the
default: the group’s rows are iterated.
Sourcefn depends_on(&self, column: R::Column) -> ColumnSet
fn depends_on(&self, column: R::Column) -> ColumnSet
The columns whose changes change the aggregate of column: that
column by default.