[−][src]Struct iban::Iban
Represents an IBAN. To obtain it, make use of the parse() function, which will make sure the
string follows the ISO 13616 standard. Apart from its own methods, Iban implements IbanLike,
which provides more functionality.
The impementation of Display provides spaced formatting of the IBAN. Electronic
formatting can be obtained via electronic_str.
A valid IBAN satisfies the defined format, has a valid checksum and has a BBAN format as defined in the IBAN registry.
Examples
use iban::*; let address = "KZ86125KZT5004100100".parse::<iban::Iban>()?; assert_eq!(address.to_string(), "KZ86 125K ZT50 0410 0100");
Implementations
impl Iban[src]
pub fn bban(&self) -> &str[src]
Get the BBAN part of the IBAN, as a &str. This method, in contrast to IbanLike::bban_unchecked,
is only available on the Iban structure, which means the returned BBAN string is always correct.
Example
use iban::*; let iban: Iban = "DE44 5001 0517 5407 3249 31".parse()?; assert_eq!(iban.bban(), "500105175407324931");
pub fn bank_identifier(&self) -> Option<&str>[src]
Get the bank identifier of the IBAN. The bank identifier might not be
defined, in which case this method returns None.
Example
use iban::*; let iban: Iban = "AD12 0001 2030 2003 5910 0100".parse()?; assert_eq!(iban.bank_identifier(), Some("0001"));
pub fn branch_identifier(&self) -> Option<&str>[src]
Get the branch identifier of the IBAN. The branch identifier might not be
defined, in which case this method returns None.
Example
use iban::*; let iban: Iban = "AD12 0001 2030 2003 5910 0100".parse()?; assert_eq!(iban.branch_identifier(), Some("2030"));
Trait Implementations
impl Clone for Iban[src]
impl Copy for Iban[src]
impl Debug for Iban[src]
impl Display for Iban[src]
impl Eq for Iban[src]
impl From<Iban> for BaseIban[src]
impl FromStr for Iban[src]
type Err = ParseIbanError
The associated error which can be returned from parsing.
fn from_str(address: &str) -> Result<Self, Self::Err>[src]
impl Hash for Iban[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl IbanLike for Iban[src]
fn electronic_str(&self) -> &str[src]
fn country_code(&self) -> &str[src]
fn check_digits_str(&self) -> &str[src]
fn check_digits(&self) -> u8[src]
fn bban_unchecked(&self) -> &str[src]
impl PartialEq<Iban> for Iban[src]
impl StructuralEq for Iban[src]
impl StructuralPartialEq for Iban[src]
impl<'a> TryFrom<&'a str> for Iban[src]
type Error = ParseIbanError
The type returned in the event of a conversion error.
fn try_from(value: &'a str) -> Result<Self, Self::Error>[src]
impl TryFrom<BaseIban> for Iban[src]
type Error = ParseIbanError
The type returned in the event of a conversion error.
fn try_from(base_iban: BaseIban) -> Result<Iban, ParseIbanError>[src]
Auto Trait Implementations
impl RefUnwindSafe for Iban
impl Send for Iban
impl Sync for Iban
impl Unpin for Iban
impl UnwindSafe for Iban
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,