Implement crate::get_seed

crate::get_seed calls Rng::get_seed on the thread-local RNG.
This commit is contained in:
Aleksander Krauze 2022-07-23 18:54:52 +02:00
parent 803cf086d9
commit 005abc5903
1 changed files with 6 additions and 0 deletions

View File

@ -591,6 +591,12 @@ pub fn seed(seed: u64) {
RNG.with(|rng| rng.seed(seed))
}
/// Gives back **current** seed that is being held by the thread-local generator.
#[inline]
pub fn get_seed() -> u64 {
RNG.with(|rng| rng.get_seed())
}
/// Generates a random `bool`.
#[inline]
pub fn bool() -> bool {