Enum fpdec::DecimalError
source · pub enum DecimalError {
MaxNFracDigitsExceeded,
InternalOverflow,
InfiniteValue,
NotANumber,
DivisionByZero,
}Expand description
An error which can be returned from converting numbers to Decimal or
from binary operators on Decimal.
This error is used as the error type for the TryFrom implementation of
Decimal. It is also used when the implementations of the numerical
operators panic.
Variants§
MaxNFracDigitsExceeded
More than MAX_N_FRAC_DIGITS fractional decimal digits requested.
InternalOverflow
The result would exceed the internal representation of Decimal.
InfiniteValue
Attempt to convert an infinite value to Decimal.
NotANumber
Attempt to convert a ‘not-a-number’ value to a Decimal.
DivisionByZero
A division op called with a divisor equal to zero.
Trait Implementations§
source§impl Clone for DecimalError
impl Clone for DecimalError
source§fn clone(&self) -> DecimalError
fn clone(&self) -> DecimalError
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 DecimalError
impl Debug for DecimalError
source§impl Display for DecimalError
impl Display for DecimalError
source§impl Error for DecimalError
impl Error for DecimalError
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 DecimalError
impl PartialEq for DecimalError
source§fn eq(&self, other: &DecimalError) -> bool
fn eq(&self, other: &DecimalError) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for DecimalError
impl StructuralEq for DecimalError
impl StructuralPartialEq for DecimalError
Auto Trait Implementations§
impl RefUnwindSafe for DecimalError
impl Send for DecimalError
impl Sync for DecimalError
impl Unpin for DecimalError
impl UnwindSafe for DecimalError
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