pub struct Pcg64 { /* private fields */ }Expand description
PCG64 PRNG
A fast, high-quality PRNG with 128-bit state. Excellent statistical properties and small code footprint. Suitable for simulations and non-cryptographic randomness.
Implementations§
Source§impl Pcg64
impl Pcg64
Sourcepub fn from_seed_obj(seed: &Seed) -> Result<Self>
pub fn from_seed_obj(seed: &Seed) -> Result<Self>
Create from a Seed object
Sourcepub fn from_state(state: u64, inc: u64) -> Self
pub fn from_state(state: u64, inc: u64) -> Self
Create with custom state and increment
Sourcepub fn fill_bytes(&mut self, dest: &mut [u8])
pub fn fill_bytes(&mut self, dest: &mut [u8])
Fill a buffer with random bytes
Sourcepub fn save_state(&self) -> [u64; 2]
pub fn save_state(&self) -> [u64; 2]
Save the current state
Sourcepub fn restore_state(&mut self, state: [u64; 2])
pub fn restore_state(&mut self, state: [u64; 2])
Restore state from saved state
Trait Implementations§
Source§impl DeterministicRng for Pcg64
impl DeterministicRng for Pcg64
Source§fn is_deterministic(&self) -> bool
fn is_deterministic(&self) -> bool
Check if the RNG is in a deterministic state
Auto Trait Implementations§
impl Freeze for Pcg64
impl RefUnwindSafe for Pcg64
impl Send for Pcg64
impl Sync for Pcg64
impl Unpin for Pcg64
impl UnwindSafe for Pcg64
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> RngCore for Twhere
T: Rng,
impl<T> RngCore for Twhere
T: Rng,
Source§fn fill_bytes(&mut self, dest: &mut [u8])
fn fill_bytes(&mut self, dest: &mut [u8])
Fill a byte buffer with random data