pub enum RngSource {
System,
Seeded(SeededRng),
}Expand description
The run’s randomness source. Checkpoint ids and run ids are minted through it — the only entropy the executor consumes.
Variants§
System
Operating-system entropy (uuid::Uuid::new_v4). The default;
identical to pre-R0.5 behavior.
Seeded(SeededRng)
A deterministic ChaCha8 stream seeded from a u64. Two runs with the
same seed mint the same id sequence, so journals and checkpoints of a
re-driven run reproduce the original’s ids.
Implementations§
Source§impl RngSource
impl RngSource
Sourcepub fn seeded(seed: u64) -> Self
pub fn seeded(seed: u64) -> Self
A seeded RNG drawing from one ChaCha8 stream per handle clone.
Sourcepub fn uuid(&self) -> Uuid
pub fn uuid(&self) -> Uuid
Mint a UUID (v4 layout in both modes: variant/version bits are set explicitly for seeded draws, so downstream consumers cannot distinguish the source from the bits).
Sourcepub fn uuid_string(&self) -> String
pub fn uuid_string(&self) -> String
Convenience: RngSource::uuid as a string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RngSource
impl RefUnwindSafe for RngSource
impl Send for RngSource
impl Sync for RngSource
impl Unpin for RngSource
impl UnsafeUnpin for RngSource
impl UnwindSafe for RngSource
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