Trait rand::distributions::uniform::SampleRange [−][src]
pub trait SampleRange<T> { fn sample_single<R: RngCore + ?Sized>(self, rng: &mut R) -> T; 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::gen_range
.
Required methods
fn sample_single<R: RngCore + ?Sized>(self, rng: &mut R) -> T
[src]
fn sample_single<R: RngCore + ?Sized>(self, rng: &mut R) -> T
[src]Generate a sample from the given range.