# 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 RNG provided will reseed itself from the operating system after generating a certain amount of randomness.

The internal RNG used is platform and architecture dependent, even if the operating system random number generator is rigged to give the same sequence always. If absolute consistency is required, explicitly select an RNG, e.g. `IsaacRng` or `Isaac64Rng`.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)