pub trait RandomSource: RngCore {
// Provided method
fn reseed(&mut self, seed: u64) { ... }
}Expand description
A pluggable source of randomness for a SimEnv.
The RngCore supertrait means env.rng().sample(dist) keeps working for
every source. Implementations that are seed-based override reseed so
that SimEnv::set_seed can restart their stream;
sources that are not seed-based (e.g. a recorded-data feed) may keep the
default, which panics — consistent with the crate’s “programming error ⇒
panic” policy.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".