pub trait FromRng{
// Provided method
fn from_rng<R: Rng + ?Sized>(rng: &mut R) -> Self { ... }
}
Expand description
Ergonomics trait for a type with a Standard
distribution, allowing values to be generated
uniformly from an Rng
by a method in its own namespace.
Example
let mut rng = StdRng::seed_from_u64(451);
let random_dir = Dir3::from_rng(&mut rng);
Construct a value of this type uniformly at random using rng
as the source of randomness.