Expand description
This crate provides a Shuttle-compatible implementation and wrapper for rand version 0.8 in order to make it
more ergonomic to run a codebase under Shuttle.
To use this crate, add something akin to the following to your Cargo.toml:
ⓘ
[features]
shuttle = [
"rand/shuttle",
]
[dependencies]
rand = { package = "shuttle-rand", version = "0.8.6" }The rest of the codebase then remains unchanged, and running with Shuttle-compatible rand can be done via the “shuttle” feature flag.
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§
- Crypto
Rng - A marker trait used to indicate that an
RngCoreorBlockRngCoreimplementation is supposed to be cryptographically secure. - Fill
- Types which may be filled with random data
- Rng
- An automatically-implemented extension trait on
RngCoreproviding high-level generic methods for sampling values and other convenience methods. - RngCore
- The core of a random number generator.
- Seedable
Rng - A random number generator that can be explicitly seeded.
Functions§
- random
- Generates a random value using the thread-local random number generator.
- 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 theDefaulttrait, makingThreadRng::default()equivalent.