Cargo Features

[dependencies]
rand = { version = "0.9.0-alpha.2", default-features = false, features = ["nightly", "serde", "std", "alloc", "getrandom", "simd_support", "std_rng", "small_rng", "unbiased", "log"] }
default = getrandom, small_rng, std, std_rng

Meta-features:

nightly

some additions requiring nightly Rust

serde

Enables serde and serde of rand_core

rand_core:

enables serde for BlockRng wrapper

std default = alloc

Option (enabled by default): without "std" rand uses libcore; this option enables functionality expected to be available on a standard platform.

Enables std of optional rand_chacha and rand_core

Affects index::sample_weighted, slice::IndexedRandom.choose_multiple_weighted, rand::random

alloc std

Option: "alloc" enables support for Vec and Box when not using "std"

Enables alloc of rand_core

Affects distribution::DistString, iterator::IteratorRandom.choose_multiple, slice::IndexedRandom.choose_multiple, slice::IndexedRandom.choose_weighted, slice::IndexedMutRandom.choose_weighted_mut, slice::SliceChooseIter

getrandom default

Option: use getrandom package for seeding

Enables getrandom of rand_core

Affects rand::random

simd_support

Option (requires nightly Rust): experimental SIMD support

Enables simd-nightly of zerocopy ^0.7.33

std_rng default = rand_chacha

Option (enabled by default): enable StdRng

Affects rand::random

small_rng default

Option: enable SmallRng

unbiased

Option: use unbiased sampling for algorithms supporting this option: Uniform distribution.
By default, bias affecting no more than one in 2^48 samples is accepted.
Note: enabling this option is expected to affect reproducibility of results.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

log implicit feature

Enables log

log:

A lightweight logging facade for Rust

rand_chacha std_rng