pub trait Function: for<'a> Routine<FunctionContext<'a>> {
// Required method
fn kinds(&self) -> &[FunctionKind];
// Provided method
fn accumulator(
&self,
_ctx: &mut FunctionContext<'_>,
) -> Option<Box<dyn Accumulator>> { ... }
}Expand description
Function-specific extension of Routine. Carries the kind discriminator
and the optional aggregate accumulator factory. Procedures do not see these
methods.
Required Methods§
Sourcefn kinds(&self) -> &[FunctionKind]
fn kinds(&self) -> &[FunctionKind]
The execution shapes this function supports (Scalar, Aggregate, Generator). Required: every function declares at least one kind.
Provided Methods§
Sourcefn accumulator(
&self,
_ctx: &mut FunctionContext<'_>,
) -> Option<Box<dyn Accumulator>>
fn accumulator( &self, _ctx: &mut FunctionContext<'_>, ) -> Option<Box<dyn Accumulator>>
Aggregate accumulator factory. Only functions whose kinds() includes
FunctionKind::Aggregate need to override this.