Trait ToRate

Source
pub trait ToRate {
    type Output;

    // Required method
    fn to_rate(self, duration: Duration) -> Self::Output;
}
Expand description

Types implementing this trait can be used to calculate Measurement::rate() from. Note: This is not implemented for u64 as it cannot be converted precisely to f64 - use f64 instead for big numbers Note: Duration can be converted to f64 but will be rounded to fit in it so it is not 100% precise for max Duration

Required Associated Types§

Required Methods§

Source

fn to_rate(self, duration: Duration) -> Self::Output

Implementors§

Source§

impl<T: Into<f64>> ToRate for T