[][src]Trait picorand::PicoRandGenerate

pub trait PicoRandGenerate<R: PicoRandRNG, T> {
    pub fn generate(&mut self) -> T;
}

Requirement for implicitly bounded RNG.

Required methods

pub fn generate(&mut self) -> T[src]

Generate a new implicitly bound number using the PRNG.

Loading content...

Implementors

impl<R: PicoRandRNG> PicoRandGenerate<R, u8> for RNG<R, u8> where
    <R as PicoRandRNG>::Output: Into<u128>, 
[src]

pub fn generate(&mut self) -> u8[src]

Generate a number in the implicit range of the type of the given RNG.

Example

use picorand::{RNG, WyRand, PicoRandGenerate};
let mut rng = RNG::<WyRand, u32>::new(0xDEADBEEF);
let generated = rng.generate();
assert!(generated >= u32::MIN || generated <= u32::MAX);

impl<R: PicoRandRNG> PicoRandGenerate<R, u16> for RNG<R, u16> where
    <R as PicoRandRNG>::Output: Into<u128>, 
[src]

pub fn generate(&mut self) -> u16[src]

Generate a number in the implicit range of the type of the given RNG.

Example

use picorand::{RNG, WyRand, PicoRandGenerate};
let mut rng = RNG::<WyRand, u32>::new(0xDEADBEEF);
let generated = rng.generate();
assert!(generated >= u32::MIN || generated <= u32::MAX);

impl<R: PicoRandRNG> PicoRandGenerate<R, u32> for RNG<R, u32> where
    <R as PicoRandRNG>::Output: Into<u128>, 
[src]

pub fn generate(&mut self) -> u32[src]

Generate a number in the implicit range of the type of the given RNG.

Example

use picorand::{RNG, WyRand, PicoRandGenerate};
let mut rng = RNG::<WyRand, u32>::new(0xDEADBEEF);
let generated = rng.generate();
assert!(generated >= u32::MIN || generated <= u32::MAX);

impl<R: PicoRandRNG> PicoRandGenerate<R, u64> for RNG<R, u64> where
    <R as PicoRandRNG>::Output: Into<u128>, 
[src]

pub fn generate(&mut self) -> u64[src]

Generate a number in the implicit range of the type of the given RNG.

Example

use picorand::{RNG, WyRand, PicoRandGenerate};
let mut rng = RNG::<WyRand, u32>::new(0xDEADBEEF);
let generated = rng.generate();
assert!(generated >= u32::MIN || generated <= u32::MAX);
Loading content...