Trait ndarray_rand::rand_distr::uniform::SampleRange [−][src]
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>(self, rng: &mut R) -> T where
R: RngCore + ?Sized,
[src]
R: RngCore + ?Sized,
Generate a sample from the given range.
pub fn is_empty(&self) -> bool
[src]
Check whether the range is empty.
Implementations on Foreign Types
impl<T> SampleRange<T> for Range<T> where
T: SampleUniform + PartialOrd<T>,
[src]
T: SampleUniform + PartialOrd<T>,
pub fn sample_single<R>(self, rng: &mut R) -> T where
R: RngCore + ?Sized,
[src]
R: RngCore + ?Sized,
pub fn is_empty(&self) -> bool
[src]
impl<T> SampleRange<T> for RangeInclusive<T> where
T: SampleUniform + PartialOrd<T>,
[src]
T: SampleUniform + PartialOrd<T>,
pub fn sample_single<R>(self, rng: &mut R) -> T where
R: RngCore + ?Sized,
[src]
R: RngCore + ?Sized,