Module fastrand::global_rng

source ยท
Expand description

A global, thread-local random number generator.

Macrosยง

Structsยง

  • RestoreOnDrop ๐Ÿ”’
    Make sure the original RNG is restored even on panic.

Constantsยง

Functionsยง

  • Generates a random char in ranges a-z and A-Z.
  • Generates a random char in ranges a-z, A-Z and 0-9.
  • Generates a random bool.
  • Generates a random char in the given range.
  • Choose an item from an iterator at random.
  • Collects amount values at random from the iterable into a vector.
  • Generates a random digit in the given base.
  • Generates a random f32 in range 0..1.
  • Generates a random f64 in range 0..1.
  • Fill a byte slice with random data.
  • Gives back current seed that is being held by the thread-local generator.
  • Generates a random i8 in the given range.
  • Generates a random i16 in the given range.
  • Generates a random i32 in the given range.
  • Generates a random i64 in the given range.
  • Generates a random i128 in the given range.
  • Generates a random isize in the given range.
  • Generates a random char in range a-z.
  • random_seed ๐Ÿ”’
  • Initializes the thread-local generator with the given seed.
  • Shuffles a slice randomly.
  • try_with_rng ๐Ÿ”’
    Try to run an operation with the current thread-local generator.
  • Generates a random u8 in the given range.
  • Generates a random u16 in the given range.
  • Generates a random u32 in the given range.
  • Generates a random u64 in the given range.
  • Generates a random u128 in the given range.
  • Generates a random char in range A-Z.
  • Generates a random usize in the given range.
  • with_rng ๐Ÿ”’
    Run an operation with the current thread-local generator.