pub trait Generatable: Sized {
// Required method
fn random(rng: &mut SafeRand) -> Result<Self, RandomError>;
}Expand description
A trait for types that can be generated randomly.
The random number generator is passed as an argument to the generate method
and must implement the SafeRand trait.
Required Methods§
fn random(rng: &mut SafeRand) -> Result<Self, RandomError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".