pub struct TryFromFloatSecsError { /* private fields */ }
Available on non-WebAssembly and crate feature
std
only.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}");
}
Trait Implementations§
1.66.0 · Source§impl Clone for TryFromFloatSecsError
impl Clone for TryFromFloatSecsError
Source§fn clone(&self) -> TryFromFloatSecsError
fn clone(&self) -> TryFromFloatSecsError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more1.66.0 · Source§impl Debug for TryFromFloatSecsError
impl Debug for TryFromFloatSecsError
1.66.0 · Source§impl Display for TryFromFloatSecsError
impl Display for TryFromFloatSecsError
1.66.0 · Source§impl Error for TryFromFloatSecsError
impl Error for TryFromFloatSecsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
1.66.0 · Source§impl PartialEq for TryFromFloatSecsError
impl PartialEq for TryFromFloatSecsError
impl Eq for TryFromFloatSecsError
impl StructuralPartialEq for TryFromFloatSecsError
Auto Trait Implementations§
impl Freeze for TryFromFloatSecsError
impl RefUnwindSafe for TryFromFloatSecsError
impl Send for TryFromFloatSecsError
impl Sync for TryFromFloatSecsError
impl Unpin for TryFromFloatSecsError
impl UnwindSafe for TryFromFloatSecsError
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