Skip to content

Commit

Permalink
Add trait implementation guidance
Browse files Browse the repository at this point in the history
Close dhardy#13
  • Loading branch information
dhardy committed Mar 18, 2018
1 parent 584a904 commit e1244a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rand-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ pub mod le;
/// in this trait directly, then use the helper functions from the [`impls`]
/// module to implement the other methods.
///
/// It is recommended that implementations also implement:
///
/// - `Debug` but such that no internal details are output
/// - `Serialize` and `Deserialize` (from Serde), possibly behind a feature gate
/// - `Clone` if, and only if, the clone will have identical output to the original
/// - *never* implement `Copy` (accidental copies may cause repeated values)
/// - `Eq` and `PartialEq` could be implemented, but are probably not useful
///
/// # Example
///
/// A simple example, obviously not generating very *random* output:
Expand Down

0 comments on commit e1244a6

Please sign in to comment.