Module nannou::rand[][src]

Items related to randomness and random number generators. Also provides some high-level helper functions.

Helper functions include random_f32(), random_f64() and random_range(min, max).

Re-exports

pub use rand;

Modules

distributions

Generating random samples from probability distributions

prelude

Convenience re-export of common members

rngs

Random number generators and adapters

seq

Sequence-related functionality

Structs

Error

Error type of random number generators

Traits

AsByteSliceMut

Trait for casting types to byte slices

CryptoRng

A marker trait used to indicate that an RngCore or BlockRngCore implementation is supposed to be cryptographically secure.

Rng

An automatically-implemented extension trait on RngCore providing high-level generic methods for sampling values and other convenience methods.

RngCore

The core of a random number generator.

SeedableRng

A random number generator that can be explicitly seeded.

Functions

random

Generates a random value using the thread-local random number generator.

random_ascii

Generates and returns a random ascii character.

random_f32

A wrapper function around the random function that avoids the need for specifying a type in the case that it cannot be inferred. The primary purpose for this is to simplify the random API for new rust users.

random_f64

A wrapper function around the random function that avoids the need for specifying a type in the case that it cannot be inferred. The primary purpose for this is to simplify the random API for new rust users.

random_range

A function for generating a random value within the given range.

thread_rng

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>(), or cached locally, e.g. let mut rng = thread_rng();. Invoked by the Default trait, making ThreadRng::default() equivalent.