Trait RandGen

Source
pub trait RandGen {
    // Required method
    fn rand_gen(rng: &mut ThreadRng) -> Self;
}
Expand description

Types that has random generator

Required Methods§

Source

fn rand_gen(rng: &mut ThreadRng) -> Self

Randomly generates a value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl RandGen for u8

Source§

fn rand_gen(rng: &mut ThreadRng) -> Self

Source§

impl RandGen for u32

Source§

fn rand_gen(rng: &mut ThreadRng) -> Self

pick only 16 bits

Source§

impl RandGen for ()

Source§

fn rand_gen(_rng: &mut ThreadRng) -> Self

Source§

impl RandGen for usize

Source§

fn rand_gen(rng: &mut ThreadRng) -> Self

pick only 16 bits, MSB=0

Implementors§