pub trait AggregateNumber:
Copy
+ PartialEq
+ PartialOrd
+ Debug
+ 'static {
type Average: Copy + PartialEq + PartialOrd + Debug + 'static;
const ZERO: Self;
// Required methods
fn plus(self, other: Self) -> Self;
fn minus(self, other: Self) -> Self;
fn average(sum: Self, count: i32) -> Self::Average;
fn to_average(self) -> Self::Average;
}Expand description
A number that the aggregations add up and average (int, long, float, double).
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn average(sum: Self, count: i32) -> Self::Average
fn average(sum: Self, count: i32) -> Self::Average
The average of count values (at least one) whose sum is sum: sum / (double)count for
the integers and double, sum / count in float for float.
Sourcefn to_average(self) -> Self::Average
fn to_average(self) -> Self::Average
The number as an average (the implicit conversion of upstream’s emptyValue).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".