#[non_exhaustive]pub enum ParseMoneyError {
Empty,
InvalidFormat,
FractionTooLong {
currency: Currency,
max_digits: u32,
},
Overflow,
}Expand description
Error returned by Money::parse_decimal.
#[non_exhaustive]: new variants may be added in a minor release.
Existing variants remain directly constructible; only exhaustive
matching from outside this crate requires a wildcard arm.
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.
Empty
The input string was empty.
InvalidFormat
The input did not match the -?\d+(\.\d+)? grammar (e.g. a leading
+, a repeated sign, whitespace, or a missing integer part).
FractionTooLong
The fractional part had a non-zero digit past the currency’s ISO
4217 exponent, i.e. more precision than the currency supports.
Trailing zero digits past that point are tolerated and do not
trigger this error — see Money::parse_decimal.
Fields
Overflow
The amount overflowed i64 minor units.
Trait Implementations§
Source§impl Clone for ParseMoneyError
impl Clone for ParseMoneyError
Source§fn clone(&self) -> ParseMoneyError
fn clone(&self) -> ParseMoneyError
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 ParseMoneyError
impl Debug for ParseMoneyError
Source§impl Display for ParseMoneyError
impl Display for ParseMoneyError
impl Eq for ParseMoneyError
Source§impl Error for ParseMoneyError
impl Error for ParseMoneyError
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 ParseMoneyError
impl PartialEq for ParseMoneyError
impl StructuralPartialEq for ParseMoneyError
Auto Trait Implementations§
impl Freeze for ParseMoneyError
impl RefUnwindSafe for ParseMoneyError
impl Send for ParseMoneyError
impl Sync for ParseMoneyError
impl Unpin for ParseMoneyError
impl UnsafeUnpin for ParseMoneyError
impl UnwindSafe for ParseMoneyError
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