pub fn generate<T>() -> Twhere
StandardUniform: Distribution<T>,Expand description
Generates a random value of type T.
This function uses the default random number generator to produce a value of type T.
The type T must implement the Distribution trait for StandardUniform.
§Returns
- A randomly generated value of type
T.
§Examples
use regd_testing;
let x: u32 = regd_testing::rand::generate();
println!("Generated number: {}", x);§Panics
- This function may panic if
Tdoes not implementDistributionforStandardUniform.