Struct rand::distributions::DistMap
source · [−]pub struct DistMap<D, F, T, S> { /* private fields */ }
Expand description
A distribution of values of type S
derived from the distribution D
by mapping its output of type T
through the closure F
.
This struct
is created by the Distribution::map
method.
See its documentation for more.
Trait Implementations
sourceimpl<D, F, T, S> Distribution<S> for DistMap<D, F, T, S> where
D: Distribution<T>,
F: Fn(T) -> S,
impl<D, F, T, S> Distribution<S> for DistMap<D, F, T, S> where
D: Distribution<T>,
F: Fn(T) -> S,
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> S
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> S
Generate a random value of T
, using rng
as the source of randomness.
sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘNotable traits for DistIter<D, R, T>impl<D, R, T> Iterator for DistIter<D, R, T> where
D: Distribution<T>,
R: Rng, type Item = T;
where
R: Rng,
Self: Sized,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘNotable traits for DistIter<D, R, T>impl<D, R, T> Iterator for DistIter<D, R, T> where
D: Distribution<T>,
R: Rng, type Item = T;
where
R: Rng,
Self: Sized,
D: Distribution<T>,
R: Rng, type Item = T;
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
Auto Trait Implementations
impl<D, F, T, S> RefUnwindSafe for DistMap<D, F, T, S> where
D: RefUnwindSafe,
F: RefUnwindSafe,
impl<D, F, T, S> Send for DistMap<D, F, T, S> where
D: Send,
F: Send,
impl<D, F, T, S> Sync for DistMap<D, F, T, S> where
D: Sync,
F: Sync,
impl<D, F, T, S> Unpin for DistMap<D, F, T, S> where
D: Unpin,
F: Unpin,
impl<D, F, T, S> UnwindSafe for DistMap<D, F, T, S> where
D: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more