@@ -91,15 +91,18 @@ pub mod le;
91
91
/// It is recommended that implementations also implement:
92
92
///
93
93
/// - `Debug` with a custom implementation which *does not* print any internal
94
- /// state (at least, [`CryptoRng`]s should not risk leaking state through Debug)
94
+ /// state (at least, [`CryptoRng`]s should not risk leaking state through
95
+ /// `Debug`).
95
96
/// - `Serialize` and `Deserialize` (from Serde), preferably making Serde
96
- /// support optional at the crate level in PRNG libs
97
- /// - `Clone` if, and only if, the clone will have identical output to the
98
- /// original (i.e. all deterministic PRNGs but not external generators)
99
- /// - *never* implement `Copy` (accidental copies may cause repeated values)
100
- /// - also *do not* implement `Default`, but instead implement `SeedableRng`
101
- /// thus allowing use of `rand::NewRng` (which is automatically implemented)
102
- /// - `Eq` and `PartialEq` could be implemented, but are probably not useful
97
+ /// support optional at the crate level in PRNG libs.
98
+ /// - `Clone`, but only if the clone will have identical output to the original
99
+ /// (i.e. be a true clone), or if the clone would be another handle to the
100
+ /// same generator.
101
+ /// - *never* implement `Copy` (accidental copies may cause repeated values).
102
+ /// - *do not* implement `Default` for pseudorandom generators, but instead
103
+ /// implement [`SeedableRng`], to guide users towards proper seeding.
104
+ /// External / hardware RNGs can choose to implement `Default`.
105
+ /// - `Eq` and `PartialEq` could be implemented, but are probably not useful.
103
106
///
104
107
/// # Example
105
108
///
0 commit comments