Crate rand
Random-number generators and samplers
Quick Start
// rand::random() supports many common types:
println!;
// Ranged sampling:
use PI;
println!;
See also The Book: Quick Start.
Modules
Structs
-
RngReader
Adapter to support
std::io::Readover aTryRng
Traits
- CryptoRng
- Fill Support filling a slice with random data
- Rng
- RngExt User-level interface for RNGs
- SeedableRng
- TryCryptoRng
- TryRng
Functions
-
fill
Fill any type implementing
Fillwith random data - make_rng Construct and seed an RNG
- random Generate a random value using the thread-local random number generator.
-
random_bool
Return a bool with a probability
pof being true. -
random_iter
Return an iterator over [
random()] variates - random_range Generate a random value in the given range using the thread-local random number generator.
-
random_ratio
Return a bool with a probability of
numerator/denominatorof being true. - rng Access a fast, pre-initialized generator