pub struct Rng { /* private fields */ }Expand description
Seeded RNG wrapper for deterministic generation
Implementations§
Source§impl Rng
impl Rng
pub fn new(seed: u64) -> Self
pub fn range(&mut self, min: i32, max: i32) -> i32
pub fn range_usize(&mut self, min: usize, max: usize) -> usize
pub fn random(&mut self) -> f64
pub fn chance(&mut self, probability: f64) -> bool
pub fn pick<'a, T>(&mut self, slice: &'a [T]) -> Option<&'a T>
pub fn shuffle<T>(&mut self, slice: &mut [T])
Auto Trait Implementations§
impl Freeze for Rng
impl RefUnwindSafe for Rng
impl Send for Rng
impl Sync for Rng
impl Unpin for Rng
impl UnwindSafe for Rng
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