pub struct Iban(/* private fields */);Expand description
Parsed and validated IBAN.
This type guarantees that the underlying string is a valid IBAN. It can only be constructed through validation.
Implementations§
Source§impl Iban
impl Iban
Sourcepub fn new(iban: &str) -> Result<Self, ValidationError>
pub fn new(iban: &str) -> Result<Self, ValidationError>
Attempts to parse and validate an IBAN string.
§Examples
use iban_check::Iban;
let iban = Iban::new("DE89370400440532013000").unwrap();Sourcepub fn country_code(&self) -> &str
pub fn country_code(&self) -> &str
Returns the country code (first two characters).
Sourcepub fn check_digits(&self) -> &str
pub fn check_digits(&self) -> &str
Returns the check digits (characters 2-4).
Trait Implementations§
impl Eq for Iban
impl StructuralPartialEq for Iban
Auto Trait Implementations§
impl Freeze for Iban
impl RefUnwindSafe for Iban
impl Send for Iban
impl Sync for Iban
impl Unpin for Iban
impl UnsafeUnpin for Iban
impl UnwindSafe for Iban
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more