Skip to main content

make_rng

Function make_rng 

pub fn make_rng<R>() -> R
where R: SeedableRng,
Expand description

Construct and seed an RNG

This method yields a seeded RNG, using rng (ThreadRng) if enabled or SysRng otherwise.

§Examples

let mut rng: rand::rngs::SmallRng = rand::make_rng();

§Panics

If SysRng fails to obtain entropy from the OS. This is unlikely outside of early boot or unusual system conditions.

§Security

Refer to ThreadRng#Security.