Skip to main content

Crate tiamat

Crate tiamat 

Source
Expand description

Pseudorandomness facilities.

This library mainly provides the RandomGen trait for (pseudo-)random number generators, the Random trait for values that can be randomly generated, and the BuildRandom generating representing relationships between distributions and their generated types. Of course, instances of these traits for common types from the standard library are provided.

Additionally, it also provides the Pcg PRNG, which supports multiple streams of randomness, has a long period, and is Quite Fast™ while having fairly good statistical properties. While it is not cryptographically secure, it is quite suited for purposes of e.g. generating levels or other things.

Structs§

Const
Wrapper struct for the constant distribution.
IterBuild
An iterator over randomly built values.
IterChooseFrom
An iterator over values randomly chosen from a slice.
IterGen
An iterator over randomly generated values.
OsRng
RandomGen that sources its randomness from the operating system.
Pcg
A Permuted Congruential Generator.

Constants§

HAS_OS_RNG
true iff OsRng supports the targeted OS.

Traits§

BuildRandom
A type defining some distribution for generating (pseudo-)random values.
Random
A type that can be (pseudo-)randomly generated using a RandomGen.
RandomGen
A (pseudo-)random number generator.