Skip to main content

NumericAccumulator

Trait NumericAccumulator 

Source
trait NumericAccumulator<T: ArrowNativeTypeOp>: Copy + Default {
    // Required methods
    fn accumulate(&mut self, value: T);
    fn accumulate_nullable(&mut self, value: T, valid: bool);
    fn merge(&mut self, other: Self);
    fn finish(&mut self) -> T;
}
Expand description

An accumulator for primitive numeric values.

Required Methods§

Source

fn accumulate(&mut self, value: T)

Accumulate a non-null value.

Source

fn accumulate_nullable(&mut self, value: T, valid: bool)

Accumulate a nullable values. If valid is false the value should not affect the accumulator state.

Source

fn merge(&mut self, other: Self)

Merge another accumulator into this accumulator

Source

fn finish(&mut self) -> T

Return the aggregated value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: ArrowNativeTypeOp> NumericAccumulator<T> for MaxAccumulator<T>

Source§

impl<T: ArrowNativeTypeOp> NumericAccumulator<T> for MinAccumulator<T>

Source§

impl<T: ArrowNativeTypeOp> NumericAccumulator<T> for SumAccumulator<T>