Trait Distribution

Source
pub trait Distribution<T> {
    // Required method
    fn sample<R>(&self, rng: &mut R, bits: u32) -> T
       where R: Rng + ?Sized;
}
Expand description

Types (distributions) that can be used to create a random instance of T.

Based on rand::distributions::Distribution.

Required Methods§

Source

fn sample<R>(&self, rng: &mut R, bits: u32) -> T
where R: Rng + ?Sized,

Generate a random value of T, using rng as the source of randomness.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§