Trait random::Source
[−]
[src]
pub trait Source { fn read_u64(&mut self) -> u64; fn read_f64(&mut self) -> f64 { ... } fn read<V>(&mut self) -> V where Self: Sized, V: Value { ... } fn iter<'l, V>(&'l mut self) -> Sequence<'l, Self, V> where Self: Sized, V: Value { ... } }
A source of randomness.
Required Methods
fn read_u64(&mut self) -> u64
Read a random u64
.
The implied distribution is a discrete uniform distribution over
{0, 1, …, u64::MAX}
.
Provided Methods
fn read_f64(&mut self) -> f64
Read a random f64
.
The implied distribution is a continuous uniform distribution over
[0, 1]
.
fn read<V>(&mut self) -> V where Self: Sized, V: Value
Read a random value.
fn iter<'l, V>(&'l mut self) -> Sequence<'l, Self, V> where Self: Sized, V: Value
Read a sequence of random values.
Implementors
impl Source for Xorshift128Plus
impl Source for Default