pub enum TryFromNumberError {
OutsideIntegerRange(TryFromIntError),
U64ToFloatLossyConversion(u64),
I64ToFloatLossyConversion(i64),
F64ToF32LossyConversion(f64),
FloatToIntegerLossyConversion(f64),
NegativeToUnsignedLossyConversion(i64),
}
Expand description
The error type returned when conversion into an integer type or floating point type is lossy.
Variants
OutsideIntegerRange(TryFromIntError)
Used when the conversion from an integer type into a smaller integer type would be lossy.
U64ToFloatLossyConversion(u64)
Used when the conversion from an u64
into a floating point type would be lossy.
I64ToFloatLossyConversion(i64)
Used when the conversion from an i64
into a floating point type would be lossy.
F64ToF32LossyConversion(f64)
Used when attempting to convert an f64
into an f32
.
FloatToIntegerLossyConversion(f64)
Used when attempting to convert a decimal, infinite, or NaN
floating point type into an
integer type.
NegativeToUnsignedLossyConversion(i64)
Used when attempting to convert a negative Number
into an unsigned integer type.
Trait Implementations
sourceimpl Debug for TryFromNumberError
impl Debug for TryFromNumberError
sourceimpl Display for TryFromNumberError
impl Display for TryFromNumberError
sourceimpl Error for TryFromNumberError
impl Error for TryFromNumberError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<TryFromIntError> for TryFromNumberError
impl From<TryFromIntError> for TryFromNumberError
sourcefn from(value: TryFromIntError) -> Self
fn from(value: TryFromIntError) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for TryFromNumberError
impl Send for TryFromNumberError
impl Sync for TryFromNumberError
impl Unpin for TryFromNumberError
impl UnwindSafe for TryFromNumberError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more