Distribution

Trait Distribution 

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

    // Provided methods
    fn sample_iter<R>(self, rng: &mut R) -> Iter<Self, &mut R, T> 
       where R: Rng,
             Self: Sized { ... }
    fn map<F, S>(self, func: F) -> Map<Self, F, T, S>
       where F: Fn(T) -> S,
             Self: Sized { ... }
}

Required Methods§

Source

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

Provided Methods§

Source

fn sample_iter<R>(self, rng: &mut R) -> Iter<Self, &mut R, T>
where R: Rng, Self: Sized,

Source

fn map<F, S>(self, func: F) -> Map<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

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§