pub trait DataSource: Debug {
type Seed: Clone;
// Required methods
fn initialize(seed: Self::Seed) -> Self;
fn reinitialize(&mut self) -> Self::Seed;
fn next_u64(&mut self) -> u64;
}Expand description
A DataSource is an oracle for generating non-deterministic data to return to a task that asks
for random values.
Required Associated Types§
Required Methods§
Sourcefn initialize(seed: Self::Seed) -> Self
fn initialize(seed: Self::Seed) -> Self
Initialize the DataSource from a given seed.
Sourcefn reinitialize(&mut self) -> Self::Seed
fn reinitialize(&mut self) -> Self::Seed
Reinitialize the DataSource and return a seed that can be used to return to this state
for deterministic replay.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".