Trait nanorand::rand::Rng[][src]

pub trait Rng: Clone {
    type Output: AsRef<[u8]>;
    fn rand(&mut self) -> Self::Output;
fn rand_with_seed(seed: &[u8]) -> Self::Output;
fn reseed(&mut self, new_seed: &[u8]); fn generate<R>(&mut self) -> R
    where
        R: RandomGen<Self>
, { ... }
fn fill<R, A>(&mut self, target: A)
    where
        R: RandomGen<Self>,
        A: AsMut<[R]>
, { ... }
fn generate_range<R, B>(&mut self, range: B) -> R
    where
        R: RandomRange<Self>,
        B: RangeBounds<R>
, { ... }
fn shuffle<I, S>(&mut self, target: S)
    where
        S: AsMut<[I]>
, { ... } }
Expand description

A trait that represents a random number generator.

Associated Types

The byte output that this RNG emits.

Required methods

Generates a random sequence of bytes, seeding from the internal state.

Generates a random sequence of bytes, with a custom seed.

Reseeds the RNG using a custom seed.

Provided methods

Generates a random of the specified type, seeding from the internal state.

Fill an array with the specified type.

Generates a random of the specified type, seeding from the internal state.

Shuffle a slice, using the RNG.

Implementors