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§
Provided Methods§
fn sample_iter<R>(self, rng: &mut R) -> Iter<Self, &mut R, T> ⓘ
fn map<F, S>(self, func: F) -> Map<Self, F, T, S>
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.