Enum iban::ParseIbanError [−][src]
pub enum ParseIbanError {
InvalidBaseIban {
source: ParseBaseIbanError,
},
InvalidBban(BaseIban),
UnknownCountry(BaseIban),
}
Expand description
An error indicating the IBAN could not be parsed.
Example
use iban::{BaseIban, Iban, ParseIbanError, ParseBaseIbanError};
use core::convert::TryFrom;
// The following IBAN has an invalid checksum
assert_eq!(
"MR00 0002 0001 0100 0012 3456 754".parse::<Iban>(),
Err(ParseIbanError::from(ParseBaseIbanError::InvalidChecksum))
);
// The following IBAN doesn't follow the country format
let base_iban: BaseIban = "AL84212110090000AB023569874".parse()?;
assert_eq!(
Iban::try_from(base_iban),
Err(ParseIbanError::InvalidBban(base_iban))
);
Variants
InvalidBaseIban
Fields
source: ParseBaseIbanError
The error indicating what went wrong when parsing the Iban.
This variant indicates that the basic IBAN structure was not followed.
InvalidBban(BaseIban)
Tuple Fields
0: BaseIban
This variant indicates that the BBAN did not follow the correct format.
The BaseIban
provides functionality on the IBAN part of the
address.
UnknownCountry(BaseIban)
Tuple Fields
0: BaseIban
This variant indicated that the country code of the IBAN was not recognized.
The BaseIban
provides functionality on the IBAN part of the
address.
Trait Implementations
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ParseIbanError
impl Send for ParseIbanError
impl Sync for ParseIbanError
impl Unpin for ParseIbanError
impl UnwindSafe for ParseIbanError
Blanket Implementations
Mutably borrows from an owned value. Read more