[][src]Trait rand::distributions::uniform::SampleRange

pub trait SampleRange<T> {
    pub fn sample_single<R: RngCore + ?Sized>(self, rng: &mut R) -> T;
pub fn is_empty(&self) -> bool; }

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

pub fn sample_single<R: RngCore + ?Sized>(self, rng: &mut R) -> T[src]

Generate a sample from the given range.

pub fn is_empty(&self) -> bool[src]

Check whether the range is empty.

Loading content...

Implementations on Foreign Types

impl<T: SampleUniform + PartialOrd> SampleRange<T> for Range<T>[src]

impl<T: SampleUniform + PartialOrd> SampleRange<T> for RangeInclusive<T>[src]

Loading content...

Implementors

Loading content...