Function random
fn random<T, impl Distribution<T>: Distribution<T>>(dist: impl Distribution<T>) -> T
Generates a random value from a distribution, using the default random source.
This is a convenience function for dist.sample(&mut DefaultRandomSource) and will sample
according to the same distribution as the underlying Distribution trait implementation. See
DefaultRandomSource for more information about how randomness is sourced.
Examples
Generating a version 4/variant 1 UUID represented as text:
use random;
let bits: u128 = random;
let g1 = as u32;
let g2 = as u16;
let g3 = as u16;
let g4 = as u16;
let g5 = as u64;
let uuid = format!;
println!;