pub struct ThreadRandom;
Expand description
A RandSource
that uses the thread-local RNG (rand::thread_rng()
).
This RNG is fast, cryptographically secure (ChaCha-based), and automatically reseeded periodically.
Each OS thread has its own RNG instance, so calls from multiple threads are contention-free and safe. This type does not store the RNG itself; it simply accesses the thread-local generator on each call.
Trait Implementations§
Source§impl Clone for ThreadRandom
impl Clone for ThreadRandom
Source§fn clone(&self) -> ThreadRandom
fn clone(&self) -> ThreadRandom
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ThreadRandom
impl Debug for ThreadRandom
Source§impl Default for ThreadRandom
impl Default for ThreadRandom
Source§fn default() -> ThreadRandom
fn default() -> ThreadRandom
Returns the “default value” for a type. Read more
Source§impl RandSource<u128> for ThreadRandom
impl RandSource<u128> for ThreadRandom
Source§impl RandSource<u64> for ThreadRandom
impl RandSource<u64> for ThreadRandom
Auto Trait Implementations§
impl Freeze for ThreadRandom
impl RefUnwindSafe for ThreadRandom
impl Send for ThreadRandom
impl Sync for ThreadRandom
impl Unpin for ThreadRandom
impl UnwindSafe for ThreadRandom
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more