pub trait SampleRange<T> {
// Required methods
fn sample_single<R: RngCore + ?Sized>(self, rng: &mut R) -> Result<T, Error>;
fn is_empty(&self) -> bool;
}
Expand description
Range that supports generating a single sample efficiently.
Any type implementing this trait can be used to specify the sampled range
for Rng::random_range
.
Required Methods§
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.