pub struct Alea { /* private fields */ }
Expand description
Seedable random number generator, faithful to javascript.
§Examples
use alea_js::Alea;
let mut a = Alea::new("frank");
assert_eq!(a.random(), 0.8080874253064394);
assert_eq!(a.random(), 0.8366762748919427);
assert_eq!(a.random(), 0.24404818122275174);
let mut a = Alea::new("frank");
assert_eq!(a.uint32(), 3470709064);
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Alea
impl RefUnwindSafe for Alea
impl Send for Alea
impl Sync for Alea
impl Unpin for Alea
impl UnwindSafe for Alea
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