fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
    where
        F: Fn(T) -> S,
        Self: Sized,
    {
        DistMap {
            distr: self,
            func,
            phantom: ::core::marker::PhantomData,
        }
    }
/// Create a distribution of values of 'S' by mapping the output of `Self`
/// through the closure `F`
///
/// # Example
///
/// ```
/// use rand::thread_rng;
/// use rand::distributions::{Distribution, Uniform};
///
/// let mut rng = thread_rng();
///
/// let die = Uniform::new_inclusive(1, 6);
/// let even_number = die.map(|num| num % 2 == 0);
/// while !even_number.sample(&mut rng) {
///     println!("Still odd; rolling again!");
/// }
/// ```
Create a distribution of values of 'S' by mapping the output of `Self`
through the closure `F`
Create a distribution of values of ' S ' by mapping the output of ` Self ` through the closure ` F `
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
    where
        F: Fn(T) -> S,
        Self: Sized,
    {
        DistMap {
            distr: self,
            func,
            phantom: ::core::marker::PhantomData,
        }
    }
fn map < F , S > ( self , func : F ) -> DistMap < Self , F , T , S > where F : Fn ( T ) -> S , Self : Sized , { DistMap { distr : self , func , phantom : :: core :: marker :: PhantomData , } }
Create a distribution of values of 'S' by mapping the output of `Self`
through the closure `F`
Create a distribution of values of ' S ' by mapping the output of ` Self ` through the closure ` F `
self
func
F
example
```
use rand::thread_rng;
use rand::distributions::{Distribution, Uniform}.

let mut rng = thread_rng().

let die = Uniform::new_inclusive(1, 6);
let even_number = die.map(|num| num % 2 == 0);
while !even_number.sample(&mut rng) {
println!("Still odd; rolling again!");
}
```
` ` ` use rand :: thread_rng ; use rand :: distributions :: { Distribution Uniform } . let mut rng = thread_rng () . let die = Uniform :: new_inclusive ( 1 6 ) ; let even_number = die . map ( |num| num % 2 == 0 ) ; while !even_number . sample ( &mut rng ) { println! ( " Still odd ; rolling again! " ) ; } ` ` `