pub struct LineItemSampler { /* private fields */ }Expand description
Sampler for journal entry line item counts.
Produces realistic line item counts based on empirical distributions from real-world general ledger data.
Implementations§
Source§impl LineItemSampler
impl LineItemSampler
Sourcepub fn with_config(
seed: u64,
line_config: LineItemDistributionConfig,
even_odd_config: EvenOddDistributionConfig,
debit_credit_config: DebitCreditDistributionConfig,
) -> Self
pub fn with_config( seed: u64, line_config: LineItemDistributionConfig, even_odd_config: EvenOddDistributionConfig, debit_credit_config: DebitCreditDistributionConfig, ) -> Self
Create a sampler with custom configuration.
Sourcepub fn sample_count(&mut self) -> usize
pub fn sample_count(&mut self) -> usize
Sample a line item count.
Sourcepub fn sample_even(&mut self) -> bool
pub fn sample_even(&mut self) -> bool
Sample whether the count should be even.
Sourcepub fn sample_count_with_parity(&mut self) -> usize
pub fn sample_count_with_parity(&mut self) -> usize
Sample a line item count with even/odd constraint.
When adjustment is needed, randomly chooses to increment or decrement to avoid biasing toward lower counts.
Sourcepub fn sample_debit_credit_type(&mut self) -> DebitCreditSplit
pub fn sample_debit_credit_type(&mut self) -> DebitCreditSplit
Sample the debit/credit split type.
Sourcepub fn sample(&mut self) -> LineItemSpec
pub fn sample(&mut self) -> LineItemSpec
Sample a complete line item specification.
Auto Trait Implementations§
impl Freeze for LineItemSampler
impl RefUnwindSafe for LineItemSampler
impl Send for LineItemSampler
impl Sync for LineItemSampler
impl Unpin for LineItemSampler
impl UnwindSafe for LineItemSampler
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