Struct rand::StdRng
[−]
[src]
pub struct StdRng { // some fields omitted }
The standard RNG. This is designed to be efficient on the current platform.
Methods
impl StdRng
fn new() -> Result<StdRng>
Create a randomly seeded instance of StdRng
.
This is a very expensive operation as it has to read
randomness from the operating system and use this in an
expensive seeding operation. If one is only generating a small
number of random numbers, or doesn't need the utmost speed for
generating each number, thread_rng
and/or random
may be more
appropriate.
Reading the randomness from the OS may fail, and any error is
propagated via the io::Result
return value.