#[non_exhaustive]pub enum MoneyArithmeticError {
CurrencyMismatch {
left: CurrencyCode,
right: CurrencyCode,
},
Overflow,
Underflow,
}Expand description
Failure from checked monetary arithmetic.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
CurrencyMismatch
Arithmetic was requested across different currencies.
Fields
§
left: CurrencyCodeCurrency of the left operand.
§
right: CurrencyCodeCurrency of the right operand.
Overflow
The result exceeded the u64 micro-unit range.
Underflow
Subtraction would have produced a negative amount.
Trait Implementations§
Source§impl Clone for MoneyArithmeticError
impl Clone for MoneyArithmeticError
Source§impl Debug for MoneyArithmeticError
impl Debug for MoneyArithmeticError
Source§impl Display for MoneyArithmeticError
impl Display for MoneyArithmeticError
impl Eq for MoneyArithmeticError
Source§impl Error for MoneyArithmeticError
impl Error for MoneyArithmeticError
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 PartialEq for MoneyArithmeticError
impl PartialEq for MoneyArithmeticError
impl StructuralPartialEq for MoneyArithmeticError
Auto Trait Implementations§
impl Forget for MoneyArithmeticError
impl Freeze for MoneyArithmeticError
impl Move for MoneyArithmeticError
impl RefUnwindSafe for MoneyArithmeticError
impl Send for MoneyArithmeticError
impl Sync for MoneyArithmeticError
impl Unpin for MoneyArithmeticError
impl UnsafeUnpin for MoneyArithmeticError
impl UnwindSafe for MoneyArithmeticError
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