pub struct Nuban { /* private fields */ }
Expand description
Contains details of account number, which includes bank code, and serial number
Implementations§
Source§impl Nuban
impl Nuban
Sourcepub fn new(bankcode: &str, serialnumber: &str) -> Nuban
pub fn new(bankcode: &str, serialnumber: &str) -> Nuban
Create new instance of Struct Nuban
# Examples
use nuban_rust::*;
let mut nuban_no = Nuban::new("011", "000001457");
Sourcepub fn full(&mut self) -> String
pub fn full(&mut self) -> String
Produces the fully valid NUBAN (including check digit) from the previously given struct value
# Examples
use nuban_rust::*;
let mut nuban_no = Nuban::new("011", "000001457");
assert_eq!(nuban_no.full(), "0110000014579");
Sourcepub fn check_digit(&self) -> u32
pub fn check_digit(&self) -> u32
Returns the correct check digit for the NUBAN details given
# Examples
use nuban_rust::*;
let nuban_no = Nuban::new("011", "000001457");
assert_eq!(nuban_no.check_digit(), 9);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Nuban
impl RefUnwindSafe for Nuban
impl Send for Nuban
impl Sync for Nuban
impl Unpin for Nuban
impl UnwindSafe for Nuban
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