Skip to main content

mul_duration_f64_saturating

Function mul_duration_f64_saturating 

Source
fn mul_duration_f64_saturating(d: Duration, mul: f64) -> Duration
Expand description

A safe variant of Duration::mul_f64 that never panics.

If the result would be outside the range of Duration, instead saturate to 0 or Duration::MAX as appropriate.

If the result would be NaN, we return an arbitrary duration.