Module flow_sdk::algorithms::rand::prelude[][src]

Expand description

Convenience re-export of common members

Like the standard library’s prelude, this module simplifies importing of common items. Unlike the standard prelude, the contents of this module must be imported manually:

use rand::prelude::*;

Structs

An RNG recommended when small state, cheap initialization and good performance are required. The PRNG algorithm in SmallRng is chosen to be efficient on the current platform, without consideration for cryptography or security. The size of its state is much smaller than for StdRng.

The standard RNG. The PRNG algorithm in StdRng is chosen to be efficient on the current platform, to be statistically strong and unpredictable (meaning a cryptographically secure PRNG).

The type returned by thread_rng, essentially just a reference to the PRNG in thread-local memory.

Traits

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

Types (distributions) that can be used to create a random instance of T.

A convenience extension to SeedableRng allowing construction from fresh entropy. This trait is automatically implemented for any PRNG implementing SeedableRng and is not intended to be implemented by users.

Extension trait on iterators, providing random sampling methods.

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

The core of a random number generator.

A random number generator that can be explicitly seeded.

Extension trait on slices, providing random mutation and sampling methods.

Functions

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

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() equivelent.