[][src]Enum iban::ParseIbanError

pub enum ParseIbanError {
    InvalidBaseIban {
        source: ParseBaseIbanError,
    },
    InvalidBban(BaseIban),
    UnknownCountry(BaseIban),
}

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

This variant indicates that the basic IBAN structure was not followed.

Fields of InvalidBaseIban

source: ParseBaseIbanError

The error indicating what went wrong when parsing the Iban.

InvalidBban(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)

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

impl Clone for ParseIbanError[src]

impl Copy for ParseIbanError[src]

impl Debug for ParseIbanError[src]

impl Display for ParseIbanError[src]

impl Eq for ParseIbanError[src]

impl Error for ParseIbanError[src]

impl From<ParseBaseIbanError> for ParseIbanError[src]

impl Hash for ParseIbanError[src]

impl PartialEq<ParseIbanError> for ParseIbanError[src]

impl StructuralEq for ParseIbanError[src]

impl StructuralPartialEq for ParseIbanError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.