Cargo Features
[dependencies]
rand = { version = "0.9.0-beta.3", default-features = false, features = ["nightly", "serde", "std", "alloc", "os_rng", "simd_support", "std_rng", "small_rng", "thread_rng", "unbiased", "log"] }
- default = os_rng, small_rng, std, std_rng, thread_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 thread_rng = 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
… - alloc std
-
Option: "alloc" enables support for Vec and Box when not using "std"
Affects
distribution::SampleString
,distr::weighted
,iterator::IteratorRandom.choose_multiple
,slice::IndexedRandom.choose_multiple
,slice::IndexedRandom.choose_weighted
,slice::IndexedMutRandom.choose_weighted_mut
,slice::SliceChooseIter
… - os_rng default thread_rng
-
Option: enable OsRng
- simd_support
-
Option (requires nightly Rust): experimental SIMD support
Enables simd-nightly of zerocopy
- std_rng default thread_rng
-
Option (enabled by default): enable StdRng
Enables rand_chacha
- small_rng default
-
Option: enable SmallRng
- thread_rng default = os_rng, std, std_rng
-
Option: enable ThreadRng and rng()
Affects
rand::thread_rng
,rand::random
,rand::random_iter
,rand::random_range
,rand::random_bool
,rand::random_ratio
,rand::fill
… - 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. - log
-
Option: enable logging
Enables log