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