Trait random::Source [] [src]

pub trait Source {
    fn read_u64(&mut self) -> u64;

    fn read_f64(&mut self) -> f64 { ... }
    fn read<T: Element>(&mut self) -> T where Self: Sized { ... }
    fn iter<'l, T: Element>(&'l mut self) -> Sequence<'l, Self, T> where Self: Sized { ... }
}

A source of randomness.

Required Methods

fn read_u64(&mut self) -> u64

Read a random u64.

The implied distribution is a uniform distribution whose support is the set {0, 1, …, u64::MAX}.

Provided Methods

fn read_f64(&mut self) -> f64

Read a random f64.

The implied distribution is a uniform distribution whose support is the interval [0, 1].

fn read<T: Element>(&mut self) -> T where Self: Sized

Read a random element.

fn iter<'l, T: Element>(&'l mut self) -> Sequence<'l, Self, T> where Self: Sized

Read a sequence of random elements.

Implementors