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

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.