pub trait Statistics {
// Required methods
fn get(&self, stat: Stat) -> Option<Scalar>;
fn to_set(&self) -> StatsSet;
fn set(&self, stat: Stat, value: Scalar);
fn compute(&self, stat: Stat) -> Option<Scalar>;
// Provided method
fn compute_all(&self, stats: &[Stat]) -> VortexResult<StatsSet> { ... }
}Required Methods§
Sourcefn get(&self, stat: Stat) -> Option<Scalar>
fn get(&self, stat: Stat) -> Option<Scalar>
Returns the value of the statistic only if it’s present
fn set(&self, stat: Stat, value: Scalar)
Provided Methods§
Sourcefn compute_all(&self, stats: &[Stat]) -> VortexResult<StatsSet>
fn compute_all(&self, stats: &[Stat]) -> VortexResult<StatsSet>
Compute all of the requested statistics (if not already present) Returns a StatsSet with the requested stats and any additional available stats