pub struct Random { /* private fields */ }Expand description
| A very simple random number generator. Not | especially good at generating truly random | bits, but good enough for our needs in this | package.
Implementations§
Source§impl Random
impl Random
pub fn new(s: u32) -> Random
pub fn next(&mut self) -> u32
Sourcepub fn uniform(&mut self, n: i32) -> u32
pub fn uniform(&mut self, n: i32) -> u32
| Returns a uniformly distributed value in the | range [0..n-1] | | REQUIRES: n > 0
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