pub trait RandomGen<Generator: Rng<OUTPUT>, const OUTPUT: usize> {
// Required method
fn random(rng: &mut Generator) -> Self;
}
Expand description
A trait used for generating a random object with an RNG,
Required Methods§
Sourcefn random(rng: &mut Generator) -> Self
fn random(rng: &mut Generator) -> Self
Return a random instance of the implementing type, from the specified RNG instance.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.