Skip to main content

Crate rand_core

Crate rand_core 

Source
Expand description

§rand_core: core random number generation traits

crate Docs Apache2/MIT licensed Build Status

This crate provides a collection of traits used by implementations of Random Number Generation (RNG) algorithms. Additionally, it includes helper utilities that assist with the implementation of these traits.

Note that the traits focus solely on the core RNG functionality. Most users should prefer the rand crate, which offers more advanced RNG capabilities built on these core traits, such as sampling from restricted ranges, generating floating-point numbers, list permutations, and more.

§License

The crate is licensed under either of:

at your option.

Modules§

block
The Generator trait and BlockRng
utils
Utilties to aid trait implementations

Structs§

UnwrapErr
Wrapper around TryRng implementation which implements Rng by panicking on potential errors.

Enums§

Infallible
The error type for errors that can never happen.

Traits§

CryptoRng
A marker trait for securely unpredictable infallible RNGs
Rng
Trait for infallible random number generators
RngCoreDeprecated
DEPRECATED: stub trait to print a deprecation warning and aid discovering that Rng is the replacement.
SeedableRng
A random number generator that can be explicitly seeded.
TryCryptoRng
A marker trait over TryRng for securely unpredictable RNGs
TryRng
Base trait for random number generators and random data sources
TryRngCoreDeprecated
DEPRECATED: stub trait to print a deprecation warning and aid discovering that TryRng is the replacement.