Struct std::time::TryFromFloatSecsError
1.66.0 · source · pub struct TryFromFloatSecsError {
kind: TryFromFloatSecsErrorKind,
}
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}");
}
RunFields§
§kind: TryFromFloatSecsErrorKind
Implementations§
Trait Implementations§
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 moresource§impl Debug for TryFromFloatSecsError
impl Debug for TryFromFloatSecsError
source§impl Display for TryFromFloatSecsError
impl Display for TryFromFloatSecsError
source§impl Eq for TryFromFloatSecsError
impl Eq for TryFromFloatSecsError
fn assert_receiver_is_total_eq(&self)
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)>
The lower-level source of this error, if any. Read more
source§fn type_id(&self, _: Internal) -> TypeIdwhere
Self: 'static,
fn type_id(&self, _: Internal) -> TypeIdwhere Self: 'static,
🔬This is a nightly-only experimental API. (
error_type_id
#60784)Gets the
TypeId
of self
.1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl PartialEq<TryFromFloatSecsError> for TryFromFloatSecsError
impl PartialEq<TryFromFloatSecsError> for TryFromFloatSecsError
source§fn eq(&self, other: &TryFromFloatSecsError) -> bool
fn eq(&self, other: &TryFromFloatSecsError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralEq for TryFromFloatSecsError
impl StructuralPartialEq for TryFromFloatSecsError
Auto Trait Implementations§
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