pub struct Pcg32 { /* private fields */ }Expand description
PCG32 (XSH-RR, 64-bit state, 32-bit output)
Implementations§
Source§impl Pcg32
impl Pcg32
Sourcepub fn new(seed: u64, stream: u64) -> Pcg32
pub fn new(seed: u64, stream: u64) -> Pcg32
the generator of seed on stream (pcg32_srandom_r(seed, stream))
pub fn next_u32(&mut self) -> u32
pub fn next_u64(&mut self) -> u64
Sourcepub fn chance_ppm(&mut self, ppm: u32) -> bool
pub fn chance_ppm(&mut self, ppm: u32) -> bool
true with probability ppm / 1 000 000 (loss and error rates)
pub fn fill(&mut self, out: &mut [u8])
Trait Implementations§
impl Eq for Pcg32
impl StructuralPartialEq for Pcg32
Auto Trait Implementations§
impl Forget for Pcg32
impl Freeze for Pcg32
impl RefUnwindSafe for Pcg32
impl Send for Pcg32
impl Sync for Pcg32
impl Unpin for Pcg32
impl UnsafeUnpin for Pcg32
impl UnwindSafe for Pcg32
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