Enum rust_decimal::Error
source · pub enum Error {
ErrorString(String),
ExceedsMaximumPossibleValue,
LessThanMinimumPossibleValue,
Underflow,
ScaleExceedsMaximumPrecision(u32),
ConversionTo(String),
}
Expand description
Error type for the library.
Variants§
ErrorString(String)
A generic error from Rust Decimal with the String
containing more information as to what
went wrong.
This is a legacy/deprecated error type retained for backwards compatibility.
ExceedsMaximumPossibleValue
The value provided exceeds Decimal::MAX
.
LessThanMinimumPossibleValue
The value provided is less than Decimal::MIN
.
Underflow
An underflow is when there are more fractional digits than can be represented within Decimal
.
ScaleExceedsMaximumPrecision(u32)
The scale provided exceeds the maximum scale that Decimal
can represent.
ConversionTo(String)
Represents a failure to convert to/from Decimal
to the specified type. This is typically
due to type constraints (e.g. Decimal::MAX
cannot be converted into i32
).
Trait Implementations§
source§impl Error for Error
impl Error for Error
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
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 for Error
impl PartialEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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