[−][src]Trait rand::distributions::range::SampleRange
The helper trait for types that have a sensible way to sample
uniformly between two values. This should not be used directly,
and is only to facilitate Range
.
Required methods
fn construct_range(low: Self, high: Self) -> Range<Self>
Construct the Range
object that sample_range
requires. This should not ever be called directly, only via
Range::new
, which will check that low < high
, so this
function doesn't have to repeat the check.
fn sample_range<R>(r: &Range<Self>, rng: &mut R) -> Self where
R: Rng,
R: Rng,
Sample a value from the given Range
with the given Rng
as
a source of randomness.
Implementations on Foreign Types
impl SampleRange for u64
[src]
fn construct_range(low: u64, high: u64) -> Range<u64>
[src]
fn sample_range<R>(r: &Range<u64>, rng: &mut R) -> u64 where
R: Rng,
[src]
R: Rng,
impl SampleRange for i32
[src]
fn construct_range(low: i32, high: i32) -> Range<i32>
[src]
fn sample_range<R>(r: &Range<i32>, rng: &mut R) -> i32 where
R: Rng,
[src]
R: Rng,
impl SampleRange for i8
[src]
fn construct_range(low: i8, high: i8) -> Range<i8>
[src]
fn sample_range<R>(r: &Range<i8>, rng: &mut R) -> i8 where
R: Rng,
[src]
R: Rng,
impl SampleRange for usize
[src]
fn construct_range(low: usize, high: usize) -> Range<usize>
[src]
fn sample_range<R>(r: &Range<usize>, rng: &mut R) -> usize where
R: Rng,
[src]
R: Rng,
impl SampleRange for i16
[src]
fn construct_range(low: i16, high: i16) -> Range<i16>
[src]
fn sample_range<R>(r: &Range<i16>, rng: &mut R) -> i16 where
R: Rng,
[src]
R: Rng,
impl SampleRange for isize
[src]
fn construct_range(low: isize, high: isize) -> Range<isize>
[src]
fn sample_range<R>(r: &Range<isize>, rng: &mut R) -> isize where
R: Rng,
[src]
R: Rng,
impl SampleRange for u16
[src]
fn construct_range(low: u16, high: u16) -> Range<u16>
[src]
fn sample_range<R>(r: &Range<u16>, rng: &mut R) -> u16 where
R: Rng,
[src]
R: Rng,
impl SampleRange for f32
[src]
fn construct_range(low: f32, high: f32) -> Range<f32>
[src]
fn sample_range<R>(r: &Range<f32>, rng: &mut R) -> f32 where
R: Rng,
[src]
R: Rng,
impl SampleRange for f64
[src]
fn construct_range(low: f64, high: f64) -> Range<f64>
[src]
fn sample_range<R>(r: &Range<f64>, rng: &mut R) -> f64 where
R: Rng,
[src]
R: Rng,
impl SampleRange for i64
[src]
fn construct_range(low: i64, high: i64) -> Range<i64>
[src]
fn sample_range<R>(r: &Range<i64>, rng: &mut R) -> i64 where
R: Rng,
[src]
R: Rng,
impl SampleRange for u32
[src]
fn construct_range(low: u32, high: u32) -> Range<u32>
[src]
fn sample_range<R>(r: &Range<u32>, rng: &mut R) -> u32 where
R: Rng,
[src]
R: Rng,
impl SampleRange for u8
[src]
fn construct_range(low: u8, high: u8) -> Range<u8>
[src]
fn sample_range<R>(r: &Range<u8>, rng: &mut R) -> u8 where
R: Rng,
[src]
R: Rng,