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 clear(&self, stat: Stat);
fn compute(&self, stat: Stat) -> Option<Scalar>;
fn retain_only(&self, stats: &[Stat]);
// 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
Sourcefn compute(&self, stat: Stat) -> Option<Scalar>
fn compute(&self, stat: Stat) -> Option<Scalar>
Computes the value of the stat if it’s not present
fn retain_only(&self, stats: &[Stat])
Provided Methods§
Sourcefn compute_all(&self, stats: &[Stat]) -> VortexResult<StatsSet>
fn compute_all(&self, stats: &[Stat]) -> VortexResult<StatsSet>
Compute all the requested statistics (if not already present) Returns a StatsSet with the requested stats and any additional available stats