1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use crate::{Headers, Row, error};
mod avg;
mod count;
mod last;
mod max;
mod min;
mod sum;
mod mul;
mod closure;
pub use avg::Avg;
pub use count::Count;
pub use last::Last;
pub use max::Max;
pub use min::Min;
pub use sum::Sum;
pub use mul::Mul;
pub use closure::Closure;
pub trait Aggregate {
fn update(&mut self, headers: &Headers, row: &Row) -> error::Result<()>;
fn value(&self) -> String;
fn colname(&self) -> &str;
}