pub enum MetricValue {
Available(f64),
NotApplicable,
Unsupported,
Error(String),
}Expand description
A metric value, or the reason it has none (ADR-0005). Never conflates “0” with “not computed”.
Variants§
Implementations§
Source§impl MetricValue
impl MetricValue
Sourcepub fn ratio(numerator: f64, denominator: f64) -> MetricValue
pub fn ratio(numerator: f64, denominator: f64) -> MetricValue
NotApplicable when the denominator is zero.
Source§impl MetricValue
impl MetricValue
Sourcepub fn mean(values: &[usize]) -> MetricValue
pub fn mean(values: &[usize]) -> MetricValue
Mean of values; NotApplicable when empty.
Sourcepub fn max(values: &[usize]) -> MetricValue
pub fn max(values: &[usize]) -> MetricValue
Maximum of values; NotApplicable when empty.
Trait Implementations§
Source§impl Clone for MetricValue
impl Clone for MetricValue
Source§impl Debug for MetricValue
impl Debug for MetricValue
Source§impl From<f64> for MetricValue
impl From<f64> for MetricValue
Source§impl From<usize> for MetricValue
impl From<usize> for MetricValue
Source§impl PartialEq for MetricValue
impl PartialEq for MetricValue
impl StructuralPartialEq for MetricValue
Auto Trait Implementations§
impl Freeze for MetricValue
impl RefUnwindSafe for MetricValue
impl Send for MetricValue
impl Sync for MetricValue
impl Unpin for MetricValue
impl UnsafeUnpin for MetricValue
impl UnwindSafe for MetricValue
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