Enum iban::BbanResult
source · pub enum BbanResult {
Valid,
Invalid,
CountryUnknown,
}
Expand description
A variant of this enum is returned by the method validate_bban()
.
Examples
use iban::Iban;
use iban::BbanResult;
// A valid BBAN
let iban1 = "DE44500105175407324931".parse::<Iban>()?;
assert_eq!(iban1.validate_bban(), BbanResult::Valid);
// An invalid BBAN
let iban2: Iban = "BA6312900794010284AC".parse()?;
assert_eq!(iban2.validate_bban(), BbanResult::Invalid);
// An unknown country
let iban3: Iban = "ZZ07273912631298461".parse()?;
assert_eq!(iban3.validate_bban(), BbanResult::CountryUnknown);
Variants
Valid
The country was recognized and the code was valid.
Invalid
The country was recognized and didn’t fit the format.
CountryUnknown
The country was not recognized.
Trait Implementations
sourceimpl Clone for BbanResult
impl Clone for BbanResult
sourcefn clone(&self) -> BbanResult
fn clone(&self) -> BbanResult
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for BbanResult
impl Debug for BbanResult
sourceimpl Hash for BbanResult
impl Hash for BbanResult
sourceimpl PartialEq<BbanResult> for BbanResult
impl PartialEq<BbanResult> for BbanResult
sourcefn eq(&self, other: &BbanResult) -> bool
fn eq(&self, other: &BbanResult) -> bool
impl Copy for BbanResult
impl Eq for BbanResult
impl StructuralEq for BbanResult
impl StructuralPartialEq for BbanResult
Auto Trait Implementations
impl RefUnwindSafe for BbanResult
impl Send for BbanResult
impl Sync for BbanResult
impl Unpin for BbanResult
impl UnwindSafe for BbanResult
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more