fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
    where
        R: Rng,
        Self: Sized,
    {
        DistIter {
            distr: self,
            rng,
            phantom: ::core::marker::PhantomData,
        }
    }
/// Create an iterator that generates random values of `T`, using `rng` as
/// the source of randomness.
///
/// Note that this function takes `self` by value. This works since
/// `Distribution<T>` is impl'd for `&D` where `D: Distribution<T>`,
/// however borrowing is not automatic hence `distr.sample_iter(...)` may
/// need to be replaced with `(&distr).sample_iter(...)` to borrow or
/// `(&*distr).sample_iter(...)` to reborrow an existing reference.
///
/// # Example
///
/// ```
/// use rand::thread_rng;
/// use rand::distributions::{Distribution, Alphanumeric, Uniform, Standard};
///
/// let mut rng = thread_rng();
///
/// // Vec of 16 x f32:
/// let v: Vec<f32> = Standard.sample_iter(&mut rng).take(16).collect();
///
/// // String:
/// let s: String = Alphanumeric
///     .sample_iter(&mut rng)
///     .take(7)
///     .map(char::from)
///     .collect();
///
/// // Dice-rolling:
/// let die_range = Uniform::new_inclusive(1, 6);
/// let mut roll_die = die_range.sample_iter(&mut rng);
/// while roll_die.next().unwrap() != 6 {
///     println!("Not a 6; rolling again!");
/// }
/// ```
Create an iterator that generates random values of `T`, using `rng` as
the source of randomness.

Note that this function takes `self` by value.
Create an iterator that generates random values of ` T ` using ` rng ` as the source of randomness . Note that this function takes ` self ` by value .
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
    where
        R: Rng,
        Self: Sized,
    {
        DistIter {
            distr: self,
            rng,
            phantom: ::core::marker::PhantomData,
        }
    }
fn sample_iter < R > ( self , rng : R ) -> DistIter < Self , R , T > where R : Rng , Self : Sized , { DistIter { distr : self , rng , phantom : :: core :: marker :: PhantomData , } }
Create an iterator that generates random values of `T`, using `rng` as
the source of randomness.
Create an iterator that generates random values of ` T ` using ` rng ` as the source of randomness .
self
rng
R
example
```
use rand::thread_rng;
use rand::distributions::{Distribution, Alphanumeric, Uniform, Standard}.

let mut rng = thread_rng().

Vec of 16 x f32:
let v: Vec = Standard.sample_iter(&mut rng).take(16).collect().

let s: String = Alphanumeric
.sample_iter(&mut rng)
.take(7)
.map(char::from)
.collect().

Dice-rolling:
let die_range = Uniform::new_inclusive(1, 6);
let mut roll_die = die_range.sample_iter(&mut rng);
while roll_die.next().unwrap() != 6 {
println!("Not a 6; rolling again!");
}
```
` ` ` use rand :: thread_rng ; use rand :: distributions :: { Distribution Alphanumeric Uniform Standard } . let mut rng = thread_rng () . Vec of 16 x f32 : let v : Vec = Standard . sample_iter ( &mut rng ) . take ( 16 ) . collect () . let s : String = Alphanumeric . sample_iter ( &mut rng ) . take ( 7 ) . map ( char :: from ) . collect () . Dice - rolling : let die_range = Uniform :: new_inclusive ( 1 6 ) ; let mut roll_die = die_range . sample_iter ( &mut rng ) ; while roll_die . next () . unwrap () ! = 6 { println! ( " Not a 6 ; rolling again! " ) ; } ` ` `