pub struct Barcode { /* private fields */ }Expand description
This struct represents a bank barcode(pankkiviivakoodi). It stores information about the IBAN, the sum (max 999999.99€), a reference number (20 digits for V4, 23 digits for V5) and the due date.
Bank barcodes may only be printed for FI IBAN numbers.
For information about constructing it, see BarcodeBuilder
§Usage
let barcode = bank_barcode::Barcode::builder()
.account_number("FI73 3131 3001 0000 58")
.build()
.unwrap();
assert_eq!("573313130010000580000000000000000000000000000000000000", barcode.to_string());Implementations§
Source§impl Barcode
impl Barcode
Sourcepub fn builder() -> BarcodeBuilder
pub fn builder() -> BarcodeBuilder
Construct a builder, for more information see BarcodeBuilder.
Examples found in repository?
examples/basic.rs (line 8)
7fn main() {
8 let barcode = Barcode::builder()
9 .version(BarcodeVersion::V5)
10 .account_number("FI79 4405 2020 0360 82")
11 .reference("RF09868516259619897")
12 .calendar_due_date(2010, 6, 12)
13 .sum(488_315)
14 .build()
15 .expect("valid barcode inputs");
16
17 println!("{barcode}");
18}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Barcode
impl RefUnwindSafe for Barcode
impl Send for Barcode
impl Sync for Barcode
impl Unpin for Barcode
impl UnsafeUnpin for Barcode
impl UnwindSafe for Barcode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more