pub enum DecimalConvertError {
Overflow,
NotFinite,
}Expand description
Error returned by the fallible TryFrom impls on I128.
Covers the two distinct failure modes:
DecimalConvertError::Overflow– the input, after scaling by10^SCALE, exceeds the range[I128::MIN, I128::MAX].DecimalConvertError::NotFinite– the float input isNaN,+inf, or-inf.
Variants§
Overflow
Input magnitude is outside [I128::MIN, I128::MAX] after scaling.
NotFinite
Input is NaN, +inf, or -inf (only reachable from the
TryFrom<f32> / TryFrom<f64> impls).
Trait Implementations§
Source§impl Clone for DecimalConvertError
impl Clone for DecimalConvertError
Source§fn clone(&self) -> DecimalConvertError
fn clone(&self) -> DecimalConvertError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DecimalConvertError
impl Debug for DecimalConvertError
Source§impl Display for DecimalConvertError
impl Display for DecimalConvertError
Source§impl Error for DecimalConvertError
Available on crate feature std only.
impl Error for DecimalConvertError
Available on crate feature
std only.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()
Source§impl Hash for DecimalConvertError
impl Hash for DecimalConvertError
Source§impl PartialEq for DecimalConvertError
impl PartialEq for DecimalConvertError
Source§fn eq(&self, other: &DecimalConvertError) -> bool
fn eq(&self, other: &DecimalConvertError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for DecimalConvertError
impl Eq for DecimalConvertError
impl StructuralPartialEq for DecimalConvertError
Auto Trait Implementations§
impl Freeze for DecimalConvertError
impl RefUnwindSafe for DecimalConvertError
impl Send for DecimalConvertError
impl Sync for DecimalConvertError
impl Unpin for DecimalConvertError
impl UnsafeUnpin for DecimalConvertError
impl UnwindSafe for DecimalConvertError
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