We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5f8bdb6 + 005abc5 commit 567ee33Copy full SHA for 567ee33
src/lib.rs
@@ -427,6 +427,12 @@ impl Rng {
427
self.0.set(seed);
428
}
429
430
+ /// Gives back **current** seed that is being held by this generator.
431
+ #[inline]
432
+ pub fn get_seed(&self) -> u64 {
433
+ self.0.get()
434
+ }
435
+
436
/// Shuffles a slice randomly.
437
#[inline]
438
pub fn shuffle<T>(&self, slice: &mut [T]) {
@@ -585,6 +591,12 @@ pub fn seed(seed: u64) {
585
591
RNG.with(|rng| rng.seed(seed))
586
592
587
593
594
+/// Gives back **current** seed that is being held by the thread-local generator.
595
+#[inline]
596
+pub fn get_seed() -> u64 {
597
+ RNG.with(|rng| rng.get_seed())
598
+}
599
588
600
/// Generates a random `bool`.
589
601
590
602
pub fn bool() -> bool {
0 commit comments