pub enum MoneyError {
CurrencyMismatch {
left: String,
right: String,
},
Overflow,
InvalidAmount(String),
Rounding(String),
Serialization(String),
}Expand description
Errors that can occur in money operations.
Variants§
CurrencyMismatch
Attempted to operate on amounts with different currencies.
Fields
Overflow
Arithmetic overflow occurred.
InvalidAmount(String)
An invalid amount was provided.
Rounding(String)
Rounding error occurred.
Serialization(String)
Serialization or deserialization error.
Trait Implementations§
Source§impl Debug for MoneyError
impl Debug for MoneyError
Source§impl Display for MoneyError
impl Display for MoneyError
Source§impl Error for MoneyError
impl Error for MoneyError
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 From<Error> for MoneyError
impl From<Error> for MoneyError
Source§fn from(e: Error) -> MoneyError
fn from(e: Error) -> MoneyError
Converts to this type from the input type.
Source§impl From<MoneyError> for PriceError
impl From<MoneyError> for PriceError
Source§fn from(source: MoneyError) -> Self
fn from(source: MoneyError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MoneyError
impl RefUnwindSafe for MoneyError
impl Send for MoneyError
impl Sync for MoneyError
impl Unpin for MoneyError
impl UnsafeUnpin for MoneyError
impl UnwindSafe for MoneyError
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