Struct TryFromFloatSecsError
1.66.0 · Source pub struct TryFromFloatSecsError { }
Expand description
An error which can be returned when converting a floating-point value of seconds
into a Duration.
This error is used as the error type for Duration::try_from_secs_f32 and
[Duration::try_from_secs_f64].
§Example
use std::time::Duration;
if let Err(e) = Duration::try_from_secs_f32(-1.0) {
println!("Failed conversion to Duration: {e}");
}
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.