1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! Items related to randomness and random number generators. Also provides some high-level helper
//! functions.
//!
//! Helper functions include [**random_f32()**](./fn.random_f32.html),
//! [**random_f64()**](./fn.random_f64.html) and [**random_range(min,
//! max)**](./fn.random_range.html).
pub use *;
pub use rand;
/// A wrapper function around the `random` function that avoids the need for specifying a type in
/// the case that it cannot be inferred. The primary purpose for this is to simplify the random API
/// for new rust users.
///
/// NOTE: This helper function relies on a thread-local RNG and is currently only available with
/// the "std" feature enabled.
/// A wrapper function around the `random` function that avoids the need for specifying a type in
/// the case that it cannot be inferred. The primary purpose for this is to simplify the random API
/// for new rust users.
///
/// NOTE: This helper function relies on a thread-local RNG and is currently only available with
/// the "std" feature enabled.
/// A function for generating a random value within the given range.
///
/// The generated value may be within the range [min, max). That is, the result is inclusive of
/// `min`, but will never be `max`.
///
/// If the given `min` is greater than the given `max`, they will be swapped before calling
/// `gen_range` internally to avoid triggering a `panic!`.
///
/// This calls `rand::thread_rng().gen_range(min..max)` internally, in turn using the thread-local
/// default random number generator.
///
/// NOTE: This helper function relies on a thread-local RNG and is currently only available with
/// the "std" feature enabled.
/// Generates and returns a random ascii character.
///
/// The ascii characters that can be generated are:
///
/// ABCDEFGHIJKLMNOPQRSTUVWXYZ\
/// abcdefghijklmnopqrstuvwxyz\
/// 0123456789)(*&^%$#@!~.
///
/// NOTE: This helper function relies on a thread-local RNG and is currently only available with
/// the "std" feature enabled.