Trait windowed_stats::experimental::series::statistic::Statistic
source · pub trait Statistic: Clone + Fill<Self::Sample> {
type Semantic: DataSemantic;
type Sample: Clone;
type Aggregation: Clone;
// Required methods
fn reset(&mut self);
fn aggregation(&self) -> Option<Self::Aggregation>;
}
Expand description
A Sampler
that folds samples into a statistical aggregation.
Required Associated Types§
sourcetype Semantic: DataSemantic
type Semantic: DataSemantic
The type of data semantic associated with samples.
sourcetype Aggregation: Clone
type Aggregation: Clone
The type of the statistical aggregation.
Required Methods§
sourcefn reset(&mut self)
fn reset(&mut self)
Resets the state (and aggregation) of the statistic.
The state of a statistic after a reset is arbitrary, but most types reset to a reasonable
initial state via Default
. Some types do nothing, such as LatchMax
, which operates
across [SamplingInterval
]s.
Statistics can be configured to reset to any given state via Reset
.
LatchMax
crate::experimental::series::statistic::LatchMax
Reset
crate::experimental::series::statistic::Reset
sourcefn aggregation(&self) -> Option<Self::Aggregation>
fn aggregation(&self) -> Option<Self::Aggregation>
Gets the statistical aggregation.
Returns None
if no aggregation is ready.
Object Safety§
This trait is not object safe.