@@ -11,13 +11,13 @@ A Rust library for random number generation.
11
11
Rand provides utilities to generate random numbers, to convert them to useful
12
12
types and distributions, and some randomness-related algorithms.
13
13
14
- Part of the functionality of Rand lives in the [ rand_core] (
15
- https://crates.io/crates/rand_core ) crate, which is not intended for users but
16
- primarily for crates implementing RNGs.
14
+ The core random number generation traits of Rand live in the [ rand_core] (
15
+ https://crates.io/crates/rand_core ) crate; this crate is most useful when
16
+ implementing RNGs.
17
17
18
18
API reference:
19
19
[ master branch] ( https://rust-lang-nursery.github.io/rand/rand/index.html ) ,
20
- [ by release] ( https://docs.rs/rand ) .
20
+ [ by release] ( https://docs.rs/rand/0.5 ) .
21
21
22
22
## Usage
23
23
@@ -36,13 +36,13 @@ extern crate rand;
36
36
use rand :: prelude :: * ;
37
37
38
38
// basic usage with random():
39
- let x : u8 = rand :: random ();
39
+ let x : u8 = random ();
40
40
println! (" {}" , x );
41
41
42
- let y = rand :: random :: <f64 >();
42
+ let y = random :: <f64 >();
43
43
println! (" {}" , y );
44
44
45
- if rand :: random () { // generates a boolean
45
+ if random () { // generates a boolean
46
46
println! (" Heads!" );
47
47
}
48
48
@@ -67,8 +67,8 @@ The Rand crate provides:
67
67
- Pseudo-random number generators: ` StdRng ` , ` SmallRng ` , ` prng ` module.
68
68
- Functionality for seeding PRNGs: the ` FromEntropy ` trait, and as sources of
69
69
external randomness ` EntropyRng ` , ` OsRng ` and ` JitterRng ` .
70
- - Most content from ` rand_core ` (re-exported): base random number generator
71
- traits and error-reporting types.
70
+ - Most content from [ ` rand_core ` ] ( https://crates.io/crates/rand_core )
71
+ (re-exported): base random number generator traits and error-reporting types.
72
72
- 'Distributions' producing many different types of random values:
73
73
- A ` Standard ` distribution for integers, floats, and derived types including
74
74
tuples, arrays and ` Option `
@@ -83,7 +83,7 @@ The Rand crate provides:
83
83
84
84
## Versions
85
85
86
- Version 0.5 is available as a pre-release and contains many breaking changes.
86
+ Version 0.5 is the latest version and contains many breaking changes.
87
87
See [ the Upgrade Guide] ( UPDATING.md ) for guidance on updating from previous
88
88
versions.
89
89
@@ -94,7 +94,7 @@ For more details, see the [changelog](CHANGELOG.md).
94
94
95
95
### Rust version requirements
96
96
97
- The 0.5 release of Rand will require ** Rustc version 1.22 or greater** .
97
+ The 0.5 release of Rand requires ** Rustc version 1.22 or greater** .
98
98
Rand 0.4 and 0.3 (since approx. June 2017) require Rustc version 1.15 or
99
99
greater. Subsets of the Rand code may work with older Rust versions, but this
100
100
is not supported.
@@ -120,8 +120,8 @@ optional features are available:
120
120
functionality depending on ` std ` :
121
121
122
122
- ` thread_rng() ` , and ` random() ` are not available, as they require thread-local
123
- storage.
124
- - ` OsRng ` is unavailable.
123
+ storage and an entropy source .
124
+ - ` OsRng ` and ` EntropyRng ` are unavailable.
125
125
- ` JitterRng ` code is still present, but a nanosecond timer must be provided via
126
126
` JitterRng::new_with_timer `
127
127
- Since no external entropy is available, it is not possible to create
0 commit comments