Struct random::Default [] [src]

pub struct Default(_);

An instance of the default source.

The default source is the Xorshift128+ algorithm.

Methods

impl Default
[src]

fn new() -> Default

Create an instance of the default source.

Each thread has its own copy of the default source, and each copy is initialized with the same default seed. Therefore, the usage is thread safe; however, each thread is responsible for reseeding its source.

fn seed(self, seed: [u64; 2]) -> Default

Seed the source.

At least one bit of the seed should be nonzero.

Trait Implementations

impl Clone for Default
[src]

fn clone(&self) -> Default

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Source for Default
[src]

fn read_u64(&mut self) -> u64

Read u64 uniformly distributed over {0, 1, …, u64::MAX}.

fn read_f64(&mut self) -> f64

Read f64 uniformly distributed 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.