pub trait Distribution<T> {
// Required method
fn sample(&self, source: &mut (impl RandomSource + ?Sized)) -> T;
}
🔬This is a nightly-only experimental API. (
random
#130703)Expand description
A trait representing a distribution of random values for a type.
Required Methods§
Sourcefn sample(&self, source: &mut (impl RandomSource + ?Sized)) -> T
🔬This is a nightly-only experimental API. (random
#130703)
fn sample(&self, source: &mut (impl RandomSource + ?Sized)) -> T
random
#130703)Samples a random value from the distribution, using the specified random source.
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.