Trait picorand::PicoRandRNG

source ·
pub trait PicoRandRNGwhere
Self::Input: TryFrom<u128>,
Self::Output: TryFrom<u128>,
{ type Input; type Output; // Required methods fn new(seed: Self::Input) -> Self; fn rand(&mut self) -> Self::Output; fn rand_range(&mut self, min: usize, max: usize) -> Self::Output; }
Expand description

Requirements for compatible PRNG.

Required Associated Types§

source

type Input

Input type for the PRNG.

source

type Output

Output type for the PRNG.

Required Methods§

source

fn new(seed: Self::Input) -> Self

Create a new PRNG instance using a specific seed.

source

fn rand(&mut self) -> Self::Output

Generate a new number using the PRNG.

source

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

Constrain a randomly generated number to a fixed range.

Implementors§