pub trait SnapshotRng: Sized {
// Required methods
fn capture(&self) -> Result<Vec<u8>, CheckpointError>;
fn restore(bytes: &[u8]) -> Result<Self, CheckpointError>;
}Expand description
An RNG whose complete internal state can be captured to bytes and restored, enabling bit-identical checkpoint resume.
Implemented for the ChaCha family (ChaCha8Rng, ChaCha12Rng,
ChaCha20Rng), all of which expose fully serializable state.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".