[][src]Trait picorand::PicoRandRNG

pub trait PicoRandRNG where
    Self::Input: TryFrom<u128>,
    Self::Output: TryFrom<u128>, 
{ type Input; type Output; pub fn new(seed: Self::Input) -> Self;
pub fn rand(&mut self) -> Self::Output;
pub fn rand_range(&mut self, min: usize, max: usize) -> Self::Output; }

Requirements for compatible PRNG.

Associated Types

type Input[src]

Input type for the PRNG.

type Output[src]

Output type for the PRNG.

Loading content...

Required methods

pub fn new(seed: Self::Input) -> Self[src]

Create a new PRNG instance using a specific seed.

pub fn rand(&mut self) -> Self::Output[src]

Generate a new number using the PRNG.

pub fn rand_range(&mut self, min: usize, max: usize) -> Self::Output[src]

Constrain a randomly generated number to a fixed range.

Loading content...

Implementors

impl PicoRandRNG for WyRand[src]

type Input = u64

Input type for the PRNG.

type Output = u64

Output type for the PRNG.

pub fn new(seed: Self::Input) -> Self[src]

Create a new WyRand instance using a specific seed.

pub fn rand(&mut self) -> Self::Output[src]

Generate a new number using the WyRand PRNG.

pub fn rand_range(&mut self, min: usize, max: usize) -> Self::Output[src]

Constrain a randomly generated number to a fixed range.

Loading content...