@@ -84,41 +84,33 @@ pinned version of Rustc if you require compatibility with a specific version.
84
84
85
85
## Crate Features
86
86
87
- Rand is built with the ` std ` and ` getrandom ` features enabled by default:
88
-
89
- - ` std ` enables functionality dependent on the ` std ` lib and implies ` alloc `
90
- and ` getrandom `
91
- - ` getrandom ` is an optional crate, providing the code behind ` rngs::OsRng ` ;
92
- the continued existance of this feature is not guaranteed so users are
93
- encouraged to specify ` std ` instead
94
-
95
- The following optional features are available:
96
-
97
- - ` alloc ` can be used instead of ` std ` to provide ` Vec ` and ` Box ` .
98
- - ` log ` enables some logging via the ` log ` crate.
99
- - ` nightly ` enables all unstable features (` simd_support ` ).
100
- - ` serde1 ` enables serialization for some types, via Serde version 1.
101
- - ` simd_support ` enables uniform sampling of SIMD types (integers and floats).
102
- - ` stdweb ` enables support for ` OsRng ` on ` wasm32-unknown-unknown ` via ` stdweb `
103
- combined with ` cargo-web ` .
104
- - ` wasm-bindgen ` enables support for ` OsRng ` on ` wasm32-unknown-unknown ` via
105
- [ ` wasm-bindgen ` ]
106
-
107
- [ `wasm-bindgen` ] : https://github.com/rustwasm/wasm-bindgen
108
-
109
- ` no_std ` mode is activated by setting ` default-features = false ` ; this removes
110
- functionality depending on ` std ` :
111
-
112
- - ` thread_rng() ` , and ` random() ` are not available, as they require thread-local
113
- storage and an entropy source.
114
- - Since no external entropy is available, it is not possible to create
115
- generators with fresh seeds using the ` FromEntropy ` trait (user must provide
116
- a seed).
117
- - Several non-linear distributions distributions are unavailable since ` exp `
118
- and ` log ` functions are not provided in ` core ` .
119
- - Large parts of the ` seq ` -uence module are unavailable, unless the ` alloc `
120
- feature is used (several APIs and many implementations require ` Vec ` ).
87
+ Rand is built with these features enabled by default:
121
88
89
+ - ` std ` enables functionality dependent on the ` std ` lib
90
+ - ` alloc ` (implied by ` std ` ) enables functionality requiring an allocator
91
+ - ` getrandom ` (implied by ` std ` ) is an optional dependency providing the code
92
+ behind ` rngs::OsRng `
93
+
94
+ Optionally, the following dependencies can be enabled:
95
+
96
+ - ` log ` enables logging via the ` log ` crate
97
+ - ` serde1 ` enables serialization for some types, via Serde version 1
98
+ - ` stdweb ` implies ` getrandom/stdweb ` to enable
99
+ ` getrandom ` support on ` wasm32-unknown-unknown `
100
+ - ` wasm-bindgen ` implies ` getrandom/wasm-bindgen ` to enable
101
+ ` getrandom ` support on ` wasm32-unknown-unknown `
102
+
103
+ Additionally, these features configure Rand:
104
+
105
+ - ` nightly ` enables all experimental features
106
+ - ` simd_support ` (experimental) enables sampling of SIMD values
107
+ (uniformly random SIMD integers and floats)
108
+
109
+ Rand supports limited functionality in ` no_std ` mode (enabled via
110
+ ` default-features = false ` ). In this case, ` OsRng ` and ` from_entropy ` are
111
+ unavailable (unless ` getrandom ` is enabled), large parts of ` seq ` are
112
+ unavailable (unless ` alloc ` is enabled), and ` thread_rng ` and ` random ` are
113
+ unavailable.
122
114
123
115
# License
124
116
0 commit comments