tiamat/
lib.rs

1//! Pseudorandomness facilities.
2//!
3//! This library mainly provides the [`RandomGen`] trait for (pseudo-)random
4//! number generators, the [`Random`] trait for values that can be randomly
5//! generated, and the [`BuildRandom`] generating representing relationships
6//! between distributions and their generated types.
7//! Of course, instances of these traits for common types from the standard
8//! library are provided.
9//!
10//! Additionally, it also provides the [`Pcg`] PRNG, which supports multiple
11//! streams of randomness, has a long period, and is Quite Fastâ„¢ while having
12//! fairly good statistical properties. While it is not cryptographically
13//! secure, it is quite suited for purposes of e.g. generating levels or other
14//! things.
15//!
16//! [`BuildRandom`]: trait.BuildRandom.html
17//! [`Pcg`]: struct.Pcg.html
18//! [`Random`]: trait.Random.html
19//! [`RandomGen`]: trait.RandomGen.html
20
21// TODO @Feature add a `shuffle` method/iterator (taking `&[T]` or `&mut [T]`)
22
23#![deny(missing_docs)]
24
25mod build_random;
26mod os;
27mod pcg;
28mod random;
29mod random_gen;
30
31pub use self::build_random::{BuildRandom, Const};
32pub use self::os::{OsRng, HAS_OS_RNG};
33pub use self::pcg::Pcg;
34pub use self::random::Random;
35pub use self::random_gen::{IterBuild, IterChooseFrom, IterGen, RandomGen};