pub struct RowRandomInt { /* private fields */ }Implementations§
Source§impl RowRandomInt
impl RowRandomInt
Sourcepub fn new(seed: i64, seeds_per_row: i32) -> Self
pub fn new(seed: i64, seeds_per_row: i32) -> Self
Creates a new random number generator with the given seed and potential number of random values per row.
Sourcepub fn new_with_default_seed_and_column_number(
column_number: i32,
seeds_per_row: i32,
) -> Self
pub fn new_with_default_seed_and_column_number( column_number: i32, seeds_per_row: i32, ) -> Self
Creates a new random number generator with a specified column number and number of
random values per row. Uses the default seed value 19620718.
Sourcepub fn new_with_column_number(
column_number: i32,
seed: i64,
seeds_per_row: i32,
) -> Self
pub fn new_with_column_number( column_number: i32, seed: i64, seeds_per_row: i32, ) -> Self
Creates a new random number generator with a specified column number and number of random values per row. The seed can be specified.
Sourcepub fn next_int(&mut self, lower_bound: i32, upper_bound: i32) -> i32
pub fn next_int(&mut self, lower_bound: i32, upper_bound: i32) -> i32
Returns a random value between lower and upper bounds (both inclusive).
Sourcepub fn row_finished(&mut self)
pub fn row_finished(&mut self)
Signals to the random number generator that we consumed the seeds for the current row and we need to start generating new ones.
Sourcepub fn advance_rows(&mut self, row_count: i64)
pub fn advance_rows(&mut self, row_count: i64)
Advance the specified number of rows which is required for partitioned datasets.
Trait Implementations§
Source§impl Clone for RowRandomInt
impl Clone for RowRandomInt
impl Copy for RowRandomInt
Source§impl Debug for RowRandomInt
impl Debug for RowRandomInt
Source§impl Default for RowRandomInt
impl Default for RowRandomInt
impl Eq for RowRandomInt
Source§impl PartialEq for RowRandomInt
impl PartialEq for RowRandomInt
impl StructuralPartialEq for RowRandomInt
Auto Trait Implementations§
impl Forget for RowRandomInt
impl Freeze for RowRandomInt
impl RefUnwindSafe for RowRandomInt
impl Send for RowRandomInt
impl Sync for RowRandomInt
impl Unpin for RowRandomInt
impl UnsafeUnpin for RowRandomInt
impl UnwindSafe for RowRandomInt
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