pub struct ReferenceGenerator { /* private fields */ }Expand description
Generator for reference numbers.
Implementations§
Source§impl ReferenceGenerator
impl ReferenceGenerator
Sourcepub fn with_company_code(self, code: &str) -> Self
pub fn with_company_code(self, code: &str) -> Self
Set the company code.
Sourcepub fn set_config(&mut self, ref_type: ReferenceType, config: ReferenceConfig)
pub fn set_config(&mut self, ref_type: ReferenceType, config: ReferenceConfig)
Set configuration for a reference type.
Sourcepub fn set_prefix(&mut self, ref_type: ReferenceType, prefix: &str)
pub fn set_prefix(&mut self, ref_type: ReferenceType, prefix: &str)
Set a custom prefix for a reference type.
Sourcepub fn generate(&mut self, ref_type: ReferenceType) -> String
pub fn generate(&mut self, ref_type: ReferenceType) -> String
Generate a reference number.
Sourcepub fn generate_for_year(
&mut self,
ref_type: ReferenceType,
year: i32,
) -> String
pub fn generate_for_year( &mut self, ref_type: ReferenceType, year: i32, ) -> String
Generate a reference number for a specific year.
Sourcepub fn generate_for_process(&mut self, process: BusinessProcess) -> String
pub fn generate_for_process(&mut self, process: BusinessProcess) -> String
Generate a reference for a business process.
Sourcepub fn generate_for_process_year(
&mut self,
process: BusinessProcess,
year: i32,
) -> String
pub fn generate_for_process_year( &mut self, process: BusinessProcess, year: i32, ) -> String
Generate a reference for a business process and year.
Sourcepub fn generate_external_reference(&self, rng: &mut impl Rng) -> String
pub fn generate_external_reference(&self, rng: &mut impl Rng) -> String
Generate an external reference (vendor invoice, etc.) with random elements.
Trait Implementations§
Source§impl Debug for ReferenceGenerator
impl Debug for ReferenceGenerator
Auto Trait Implementations§
impl Freeze for ReferenceGenerator
impl RefUnwindSafe for ReferenceGenerator
impl Send for ReferenceGenerator
impl Sync for ReferenceGenerator
impl Unpin for ReferenceGenerator
impl UnwindSafe for ReferenceGenerator
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