pub struct Random { /* private fields */ }
Expand description
wiki | A simple xoshiro256** PRNG
I know, I know, first rule of PRNG club is don’t roll your own, just use the library. I’m pretty sure my Math chops are up to understanding this stuff well enough to bend that rule a bit, and I just don’t like the standard library for this application. Xoshiro crate is better, but contains a lot of stuff I don’t need.
Implementations§
source§impl Random
impl Random
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new randomizer object. Will be lazily initialized and seeded on first use.
sourcepub fn jump(&mut self)
pub fn jump(&mut self)
Jump is equivalent to 2^128 calls to next(); it can be used to generate non-overlapping subsequences for parallel computations.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Random
impl RefUnwindSafe for Random
impl Send for Random
impl Sync for Random
impl Unpin for Random
impl UnwindSafe for Random
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)