pub struct Sum<T> { /* private fields */ }
Expand description
Sum statistic.
The sum directly computes the aggregation in the domain of samples.
This statistic is sensitive to overflow in the sum of samples.
Implementations§
Trait Implementations§
Source§impl Statistic for Sum<i64>
impl Statistic for Sum<i64>
Source§type Aggregation = i64
type Aggregation = i64
The type of the statistical aggregation.
Source§fn fold(&mut self, sample: Self::Sample) -> Result<(), FoldError>
fn fold(&mut self, sample: Self::Sample) -> Result<(), FoldError>
Folds a sample into the aggregation of the statistic. Read more
Source§fn fill(
&mut self,
sample: Self::Sample,
n: NonZeroUsize,
) -> Result<(), FoldError>
fn fill( &mut self, sample: Self::Sample, n: NonZeroUsize, ) -> Result<(), FoldError>
Folds a sample into the aggregation of a statistic
n
(one or more) times. Read moreSource§fn aggregation(&self) -> Option<Self::Aggregation>
fn aggregation(&self) -> Option<Self::Aggregation>
Gets the statistical aggregation. Read more
Source§impl Statistic for Sum<u64>
impl Statistic for Sum<u64>
Source§type Aggregation = u64
type Aggregation = u64
The type of the statistical aggregation.
Source§fn fold(&mut self, sample: Self::Sample) -> Result<(), FoldError>
fn fold(&mut self, sample: Self::Sample) -> Result<(), FoldError>
Folds a sample into the aggregation of the statistic. Read more
Source§fn fill(
&mut self,
sample: Self::Sample,
n: NonZeroUsize,
) -> Result<(), FoldError>
fn fill( &mut self, sample: Self::Sample, n: NonZeroUsize, ) -> Result<(), FoldError>
Folds a sample into the aggregation of a statistic
n
(one or more) times. Read moreSource§fn aggregation(&self) -> Option<Self::Aggregation>
fn aggregation(&self) -> Option<Self::Aggregation>
Gets the statistical aggregation. Read more
Auto Trait Implementations§
impl<T> Freeze for Sum<T>where
T: Freeze,
impl<T> RefUnwindSafe for Sum<T>where
T: RefUnwindSafe,
impl<T> Send for Sum<T>where
T: Send,
impl<T> Sync for Sum<T>where
T: Sync,
impl<T> Unpin for Sum<T>where
T: Unpin,
impl<T> UnwindSafe for Sum<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<F> StatisticExt for Fwhere
F: Statistic,
impl<F> StatisticExt for Fwhere
F: Statistic,
Source§fn get_aggregation_and_reset(&mut self) -> Option<Self::Aggregation>
fn get_aggregation_and_reset(&mut self) -> Option<Self::Aggregation>
Gets the statistical aggregation and resets the statistic.