A generic random value distribution, implemented for many primitive types.
Usually generates values with a numerically uniform distribution, and with a
range appropriate to the type.
Assuming the provided Rng
is well-behaved, these implementations
generate values with the following ranges and distributions:
- Integers (
i32
, u32
, isize
, usize
, etc.): Uniformly distributed
over all values of the type.
char
: Uniformly distributed over all Unicode scalar values, i.e. all
code points in the range 0...0x10_FFFF
, except for the range
0xD800...0xDFFF
(the surrogate code points). This includes
unassigned/reserved code points.
bool
: Generates false
or true
, each with probability 0.5.
- Floating point types (
f32
and f64
): Uniformly distributed in the
half-open range [0, 1)
. See notes below.
- Wrapping integers (
Wrapping<T>
), besides the type identical to their
normal integer variants.
The Standard
distribution also supports generation of the following
compound types where all component types are supported:
- Tuples (up to 12 elements): each element is generated sequentially.
- Arrays (up to 32 elements): each element is generated sequentially;
see also
Rng::fill
which supports arbitrary array length for integer
types and tends to be faster for u32
and smaller types.
When using rustc
≥ 1.51, enable the min_const_gen
feature to support
arrays larger than 32 elements.
Note that Rng::fill
and Standard
’s array support are not equivalent:
the former is optimised for integer types (using fewer RNG calls for
element types smaller than the RNG word size), while the latter supports
any element type supported by Standard
.
Option<T>
first generates a bool
, and if true generates and returns
Some(value)
where value: T
, otherwise returning None
.
The Standard
distribution may be implemented for user types as follows:
use rand::Rng;
use rand::distributions::{Distribution, Standard};
struct MyF32 {
x: f32,
}
impl Distribution<MyF32> for Standard {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> MyF32 {
MyF32 { x: rng.gen() }
}
}
use rand::prelude::*;
use rand::distributions::Standard;
let val: f32 = StdRng::from_entropy().sample(Standard);
println!("f32 from [0, 1): {}", val);
The floating point implementations for Standard
generate a random value in
the half-open interval [0, 1)
, i.e. including 0 but not 1.
All values that can be generated are of the form n * ε/2
. For f32
the 24 most significant random bits of a u32
are used and for f64
the
53 most significant bits of a u64
are used. The conversion uses the
multiplicative method: (rng.gen::<$uty>() >> N) as $ty * (ε/2)
.
See also: Open01
which samples from (0, 1)
, OpenClosed01
which
samples from (0, 1]
and Rng::gen_range(0..1)
which also samples from
[0, 1)
. Note that Open01
uses transmute-based methods which yield 1 bit
less precision but may perform faster on some architectures (on modern Intel
CPUs all methods have approximately equal performance).
Formats the value using the given formatter. Read more
Note: the String
is potentially left with excess capacity; optionally the
user may call string.shrink_to_fit()
afterwards.
Append len
random chars to string
Generate a String
of len
random chars
Generate a random value 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. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 1]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 1]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 10]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 10]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 11]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 11]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 12]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 12]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 13]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 13]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 14]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 14]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 15]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 15]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 16]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 16]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 17]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 17]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 18]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 18]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 19]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 19]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 2]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 2]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 20]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 20]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 21]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 21]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 22]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 22]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 23]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 23]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 24]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 24]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 25]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 25]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 26]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 26]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 27]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 27]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 28]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 28]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 29]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 29]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 3]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 3]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 30]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 30]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 31]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 31]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 32]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 32]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 4]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 4]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 5]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 5]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 6]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 6]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 7]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 7]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 8]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 8]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<[T; 9]> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> [T; 9]
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<()> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B, C, D, E, F, G, H, I, J, K, L> Distribution<(A, B, C, D, E, F, G, H, I, J, K, L)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
Standard: Distribution<F>,
Standard: Distribution<G>,
Standard: Distribution<H>,
Standard: Distribution<I>,
Standard: Distribution<J>,
Standard: Distribution<K>,
Standard: Distribution<L>,
[src]
fn sample<R: Rng + ?Sized>(
&self,
_rng: &mut R
) -> (A, B, C, D, E, F, G, H, I, J, K, L)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B, C, D, E, F, G, H, I, J, K> Distribution<(A, B, C, D, E, F, G, H, I, J, K)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
Standard: Distribution<F>,
Standard: Distribution<G>,
Standard: Distribution<H>,
Standard: Distribution<I>,
Standard: Distribution<J>,
Standard: Distribution<K>,
[src]
fn sample<R: Rng + ?Sized>(
&self,
_rng: &mut R
) -> (A, B, C, D, E, F, G, H, I, J, K)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B, C, D, E, F, G, H, I, J> Distribution<(A, B, C, D, E, F, G, H, I, J)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
Standard: Distribution<F>,
Standard: Distribution<G>,
Standard: Distribution<H>,
Standard: Distribution<I>,
Standard: Distribution<J>,
[src]
fn sample<R: Rng + ?Sized>(
&self,
_rng: &mut R
) -> (A, B, C, D, E, F, G, H, I, J)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B, C, D, E, F, G, H, I> Distribution<(A, B, C, D, E, F, G, H, I)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
Standard: Distribution<F>,
Standard: Distribution<G>,
Standard: Distribution<H>,
Standard: Distribution<I>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> (A, B, C, D, E, F, G, H, I)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B, C, D, E, F, G, H> Distribution<(A, B, C, D, E, F, G, H)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
Standard: Distribution<F>,
Standard: Distribution<G>,
Standard: Distribution<H>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> (A, B, C, D, E, F, G, H)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B, C, D, E, F, G> Distribution<(A, B, C, D, E, F, G)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
Standard: Distribution<F>,
Standard: Distribution<G>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> (A, B, C, D, E, F, G)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B, C, D, E, F> Distribution<(A, B, C, D, E, F)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
Standard: Distribution<F>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> (A, B, C, D, E, F)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B, C, D, E> Distribution<(A, B, C, D, E)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> (A, B, C, D, E)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B, C, D> Distribution<(A, B, C, D)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> (A, B, C, D)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B, C> Distribution<(A, B, C)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> (A, B, C)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A, B> Distribution<(A, B)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> (A, B)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<A> Distribution<(A,)> for Standard where
Standard: Distribution<A>,
[src]
fn sample<R: Rng + ?Sized>(&self, _rng: &mut R) -> (A,)
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<NonZeroU128> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> NonZeroU128
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<NonZeroU16> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> NonZeroU16
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<NonZeroU32> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> NonZeroU32
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<NonZeroU64> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> NonZeroU64
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<NonZeroU8> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> NonZeroU8
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<NonZeroUsize> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> NonZeroUsize
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<Option<T>> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Option<T>
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl<T> Distribution<Wrapping<T>> for Standard where
Standard: Distribution<T>,
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Wrapping<T>
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<bool> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> bool
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<char> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> char
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<f32> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f32
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<f64> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<i128> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> i128
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<i16> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> i16
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<i32> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> i32
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<i64> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> i64
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<i8> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> i8
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<isize> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> isize
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<u128> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> u128
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<u16> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> u16
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<u32> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> u32
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<u64> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> u64
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<u8> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> u8
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Distribution<usize> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> usize
[src]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Self: Sized,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S> where
F: Fn(T) -> S,
Self: Sized,
[src]
Create a distribution of values of ‘S’ by mapping the output of Self
through the closure F
Read more
impl Copy for Standard
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]