pub struct Rand { /* private fields */ }
Implementations§
Source§impl Rand
impl Rand
Sourcepub fn new(seed: u64) -> Self
pub fn new(seed: u64) -> Self
Creates instance of random number generator.
use simple_rnd::Rand;
let mut rand = Rand::new(0);
println!("{}", rand.next());
Examples found in repository?
More examples
Sourcepub fn next(&mut self) -> u64
pub fn next(&mut self) -> u64
Generates the next random u64 number.
use simple_rnd::Rand;
let mut rand = Rand::new(0);
println!("{}", rand.next());
Examples found in repository?
More examples
Auto Trait Implementations§
impl Freeze for Rand
impl RefUnwindSafe for Rand
impl Send for Rand
impl Sync for Rand
impl Unpin for Rand
impl UnwindSafe for Rand
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