[][src]Enum iban::ParseBaseIbanError

pub enum ParseBaseIbanError {
    InvalidFormat,
    InvalidChecksum,
}

Indicates that the string does not follow the basic IBAN rules.

Example

An example of parsing invalid IBANs:

use iban::{BaseIban, ParseBaseIbanError};

// Invalid formatting because the spaces are in the wrong places
assert_eq!(
    "MR0 041 9".parse::<BaseIban>(),
    Err(ParseBaseIbanError::InvalidFormat)
);

// This IBAN follows the correct basic format but has an invalid checksum
assert_eq!(
    "MR00 0002 0001 0100 0012 3456 754".parse::<BaseIban>(),
    Err(ParseBaseIbanError::InvalidChecksum)
);

Variants

InvalidFormat

The string doesn't have the correct format to be an IBAN. This can be because it's too short, too long or because it contains unexpected characters at some location.

InvalidChecksum

The IBAN has an invalid structure.

Trait Implementations

impl Clone for ParseBaseIbanError[src]

impl Copy for ParseBaseIbanError[src]

impl Debug for ParseBaseIbanError[src]

impl Display for ParseBaseIbanError[src]

impl Eq for ParseBaseIbanError[src]

impl Error for ParseBaseIbanError[src]

impl From<ParseBaseIbanError> for ParseIbanError[src]

impl Hash for ParseBaseIbanError[src]

impl PartialEq<ParseBaseIbanError> for ParseBaseIbanError[src]

impl StructuralEq for ParseBaseIbanError[src]

impl StructuralPartialEq for ParseBaseIbanError[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.