Cargo Features
[dependencies]
rand = { version = "0.9.0-alpha.1", default-features = false, features = ["nightly", "serde1", "std", "alloc", "getrandom", "simd_support", "std_rng", "small_rng", "unbiased", "log"] }
- default = getrandom, std, std_rng
-
Meta-features:
- nightly
-
some additions requiring nightly Rust
- serde1 = serde
-
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
,seq::IndexedRandom.choose_multiple_weighted
,rand::random
… - alloc std
-
Option: "alloc" enables support for Vec and Box when not using "std"
Affects
distribution::DistString
,seq::index
,seq::IndexedRandom.choose_multiple
,seq::IndexedRandom.choose_weighted
,seq::IndexedMutRandom.choose_weighted_mut
,seq::IteratorRandom.choose_multiple
,seq::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.8.0-alpha.6
- std_rng default = rand_chacha
-
Option (enabled by default): enable StdRng
Affects
rand::random
… - small_rng
-
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.