pub struct OrderGenerator<'a> { /* private fields */ }Expand description
Generator for Order table data
Implementations§
Source§impl<'a> OrderGenerator<'a>
impl<'a> OrderGenerator<'a>
Sourcepub const SCALE_BASE: i32 = 1_500_000i32
pub const SCALE_BASE: i32 = 1_500_000i32
Base scale for order generation
pub const LINE_COUNT_MAX: i32 = 7i32
Sourcepub fn new(
scale_factor: f64,
part: i32,
part_count: i32,
) -> OrderGenerator<'static>
pub fn new( scale_factor: f64, part: i32, part_count: i32, ) -> OrderGenerator<'static>
Creates a new OrderGenerator with the given scale factor
Note the generator’s lifetime is &'static. See NationGenerator for
more details.
Sourcepub fn new_with_distributions_and_text_pool<'b>(
scale_factor: f64,
part: i32,
part_count: i32,
distributions: &'b Distributions,
text_pool: &'b TextPool,
) -> OrderGenerator<'b>
pub fn new_with_distributions_and_text_pool<'b>( scale_factor: f64, part: i32, part_count: i32, distributions: &'b Distributions, text_pool: &'b TextPool, ) -> OrderGenerator<'b>
Creates a OrderGenerator with specified distributions and text pool
Sourcepub fn calculate_row_count(scale_factor: f64, part: i32, part_count: i32) -> i64
pub fn calculate_row_count(scale_factor: f64, part: i32, part_count: i32) -> i64
Return the row count for the given scale factor and generator part count
Sourcepub fn iter(&self) -> OrderGeneratorIterator<'a> ⓘ
pub fn iter(&self) -> OrderGeneratorIterator<'a> ⓘ
Returns an iterator over the order rows
Sourcepub fn create_order_date_random() -> RandomBoundedInt
pub fn create_order_date_random() -> RandomBoundedInt
Creates the order date random generator
Sourcepub fn create_line_count_random() -> RandomBoundedInt
pub fn create_line_count_random() -> RandomBoundedInt
Creates the line count random generator
Sourcepub fn make_order_key(order_index: i64) -> i64
pub fn make_order_key(order_index: i64) -> i64
Creates an order key from an index
Trait Implementations§
Source§impl<'a> Clone for OrderGenerator<'a>
impl<'a> Clone for OrderGenerator<'a>
Source§fn clone(&self) -> OrderGenerator<'a>
fn clone(&self) -> OrderGenerator<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for OrderGenerator<'a>
impl<'a> Debug for OrderGenerator<'a>
Source§impl<'a> IntoIterator for OrderGenerator<'a>
impl<'a> IntoIterator for OrderGenerator<'a>
Auto Trait Implementations§
impl<'a> Freeze for OrderGenerator<'a>
impl<'a> RefUnwindSafe for OrderGenerator<'a>
impl<'a> Send for OrderGenerator<'a>
impl<'a> Sync for OrderGenerator<'a>
impl<'a> Unpin for OrderGenerator<'a>
impl<'a> UnwindSafe for OrderGenerator<'a>
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