pub struct TreeRng<Rng = Pcg64Mcg> { /* private fields */ }Expand description
A hierarchical pseudo-random number generator (PRNG).
TreeRng organizes RNGs into a tree structure, allowing you to create independent
child RNGs from a parent RNG. This ensures stability and reproducibility in random number
generation across code changes.
§Type Parameters
Rng: A PRNG type that implements bothSeedableRngandRngCore.
Implementations§
Source§impl<Rng: SeedableRng + RngCore> TreeRng<Rng>
impl<Rng: SeedableRng + RngCore> TreeRng<Rng>
Trait Implementations§
Auto Trait Implementations§
impl<Rng> Freeze for TreeRng<Rng>where
Rng: Freeze,
impl<Rng> RefUnwindSafe for TreeRng<Rng>where
Rng: RefUnwindSafe,
impl<Rng> Send for TreeRng<Rng>where
Rng: Send,
impl<Rng> Sync for TreeRng<Rng>where
Rng: Sync,
impl<Rng> Unpin for TreeRng<Rng>where
Rng: Unpin,
impl<Rng> UnwindSafe for TreeRng<Rng>where
Rng: UnwindSafe,
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
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of a RNG error.
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
Return the next random
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
Return the next random
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
Fill
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
Wrap RNG with the
UnwrapMut wrapper.