Function rand::thread_rng [] [src]

pub fn thread_rng() -> ThreadRng

Retrieve the lazily-initialized thread-local random number generator, seeded by the system. Intended to be used in method chaining style, e.g. thread_rng().gen::<i32>().

The internal RNG used is the one defined by StdRng. After generating 32KiB of random bytes, the RNG will reseed itself from the operating system or, if the operating system RNG returns an error, the JitterRng entropy collector.