# Trait rand::Rand [−] [src]

    pub trait Rand: Sized {
        fn rand<R: Rng>(rng: &mut R) -> Self;
    }

A type that can be randomly generated using an `Rng`.

## Required Methods

### `fn rand<R: Rng>(rng: &mut R) -> Self`

Generates a random instance of this type using the specified source of randomness.

## Implementors

- `impl Rand for StandardNormal`
- `impl Rand for Exp1`
- `impl Rand for IsaacRng`
- `impl Rand for Isaac64Rng`
- `impl Rand for ChaChaRng`
- `impl Rand for f64`
- `impl Rand for Open01<f64>`
- `impl Rand for Closed01<f64>`
- `impl Rand for f32`
- `impl Rand for Open01<f32>`
- `impl Rand for Closed01<f32>`
- `impl Rand for isize`
- `impl Rand for i8`
- `impl Rand for i16`
- `impl Rand for i32`
- `impl Rand for i64`
- `impl Rand for usize`
- `impl Rand for u8`
- `impl Rand for u16`
- `impl Rand for u32`
- `impl Rand for u64`
- `impl Rand for char`
- `impl Rand for bool`
- `impl Rand for ()`
- `impl<A: Rand> Rand for (A,)`
- `impl<A: Rand, B: Rand> Rand for (A, B)`
- `impl<A: Rand, B: Rand, C: Rand> Rand for (A, B, C)`
- `impl<A: Rand, B: Rand, C: Rand, D: Rand> Rand for (A, B, C, D)`
- `impl<A: Rand, B: Rand, C: Rand, D: Rand, E: Rand> Rand for (A, B, C, D, E)`
- `impl<A: Rand, B: Rand, C: Rand, D: Rand, E: Rand, F: Rand> Rand for (A, B, C, D, E, F)`
- `impl<A: Rand, B: Rand, C: Rand, D: Rand, E: Rand, F: Rand, G: Rand> Rand for (A, B, C, D, E, F, G)`
- `impl<A: Rand, B: Rand, C: Rand, D: Rand, E: Rand, F: Rand, G: Rand, H: Rand> Rand for (A, B, C, D, E, F, G, H)`
- `impl<A: Rand, B: Rand, C: Rand, D: Rand, E: Rand, F: Rand, G: Rand, H: Rand, I: Rand> Rand for (A, B, C, D, E, F, G, H, I)`
- `impl<A: Rand, B: Rand, C: Rand, D: Rand, E: Rand, F: Rand, G: Rand, H: Rand, I: Rand, J: Rand> Rand for (A, B, C, D, E, F, G, H, I, J)`
- `impl<A: Rand, B: Rand, C: Rand, D: Rand, E: Rand, F: Rand, G: Rand, H: Rand, I: Rand, J: Rand, K: Rand> Rand for (A, B, C, D, E, F, G, H, I, J, K)`
- `impl<A: Rand, B: Rand, C: Rand, D: Rand, E: Rand, F: Rand, G: Rand, H: Rand, I: Rand, J: Rand, K: Rand, L: Rand> Rand for (A, B, C, D, E, F, G, H, I, J, K, L)`
- `impl<T> Rand for [T; 0]`
- `impl<T> Rand for [T; 1] where
  T: Rand,`
- `impl<T> Rand for [T; 2] where
  T: Rand,`
- `impl<T> Rand for [T; 3] where
  T: Rand,`
- `impl<T> Rand for [T; 4] where
  T: Rand,`
- `impl<T> Rand for [T; 5] where
  T: Rand,`
- `impl<T> Rand for [T; 6] where
  T: Rand,`
- `impl<T> Rand for [T; 7] where
  T: Rand,`
- `impl<T> Rand for [T; 8] where
  T: Rand,`
- `impl<T> Rand for [T; 9] where
  T: Rand,`
- `impl<T> Rand for [T; 10] where
  T: Rand,`
- `impl<T> Rand for [T; 11] where
  T: Rand,`
- `impl<T> Rand for [T; 12] where
  T: Rand,`
- `impl<T> Rand for [T; 13] where
  T: Rand,`
- `impl<T> Rand for [T; 14] where
  T: Rand,`
- `impl<T> Rand for [T; 15] where
  T: Rand,`
- `impl<T> Rand for [T; 16] where
  T: Rand,`
- `impl<T> Rand for [T; 17] where
  T: Rand,`
- `impl<T> Rand for [T; 18] where
  T: Rand,`
- `impl<T> Rand for [T; 19] where
  T: Rand,`
- `impl<T> Rand for [T; 20] where
  T: Rand,`
- `impl<T> Rand for [T; 21] where
  T: Rand,`
- `impl<T> Rand for [T; 22] where
  T: Rand,`
- `impl<T> Rand for [T; 23] where
  T: Rand,`
- `impl<T> Rand for [T; 24] where
  T: Rand,`
- `impl<T> Rand for [T; 25] where
  T: Rand,`
- `impl<T> Rand for [T; 26] where
  T: Rand,`
- `impl<T> Rand for [T; 27] where
  T: Rand,`
- `impl<T> Rand for [T; 28] where
  T: Rand,`
- `impl<T> Rand for [T; 29] where
  T: Rand,`
- `impl<T> Rand for [T; 30] where
  T: Rand,`
- `impl<T> Rand for [T; 31] where
  T: Rand,`
- `impl<T> Rand for [T; 32] where
  T: Rand,`
- `impl<T: Rand> Rand for Option<T>`
- `impl Rand for XorShiftRng`

# 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`)