use crate::{
JsonPrimitive,
parser::{
aggregators_helper::Accumulator,
analyzer::{AnalysisContext, AnalyzerError},
ast::Function,
},
};
pub trait AggregateImpl: Send + Sync {
fn name(&self) -> &'static str;
fn infer_type(
&self,
fun: &Function,
ctx: &AnalysisContext,
) -> Result<(JsonPrimitive, bool), AnalyzerError>;
fn allow_fold(&self) -> bool {
false
}
fn create_accumulator(&self) -> Box<dyn Accumulator>;
}