pub trait FromRngwhere Self: Sized, Standard: Distribution<Self>,{ // Provided method fn from_rng<R: Rng + ?Sized>(rng: &mut R) -> Self { ... } }
rand
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.
Standard
Rng
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.
rng