#[non_exhaustive]pub enum Error {
InvalidCode,
InvalidLength,
InvalidCharset,
NoUniversalCurrency,
}Expand description
Errors encountered when interacting ISO 4217 currency codes.
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.
InvalidCode
The code given is not a correct string or numeric code.
InvalidLength
The code string given is the wrong length to be a currency code.
InvalidCharset
The code string given contains non-ASCII characters.
NoUniversalCurrency
The country in question does not have a universal currency.
Implementations§
Source§impl Error
impl Error
Sourcepub const fn is_invalid_code(&self) -> bool
pub const fn is_invalid_code(&self) -> bool
Whether this error is of the InvalidCode variant.
Sourcepub const fn is_invalid_length(&self) -> bool
pub const fn is_invalid_length(&self) -> bool
Whether this error is of the InvalidLength variant.
Sourcepub const fn is_invalid_charset(&self) -> bool
pub const fn is_invalid_charset(&self) -> bool
Whether this error is of the InvalidCharset variant.
Sourcepub const fn is_no_universal_currency(&self) -> bool
pub const fn is_no_universal_currency(&self) -> bool
Whether this error is of the InvalidCharset variant.
Trait Implementations§
Source§impl Ord for Error
impl Ord for Error
Source§impl PartialOrd for Error
impl PartialOrd for Error
impl Copy for Error
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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