Struct ndarray_rand::rand_distr::Standard [−][src]
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.
Provided implementations
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 range0...0x10_FFFF
, except for the range0xD800...0xDFFF
(the surrogate code points). This includes unassigned/reserved code points.bool
: Generatesfalse
ortrue
, each with probability 0.5.- Floating point types (
f32
andf64
): 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 foru32
and smaller types. Option<T>
first generates abool
, and if true generates and returnsSome(value)
wherevalue: T
, otherwise returningNone
.
Custom implementations
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() } } }
Example usage
use rand::prelude::*; use rand::distributions::Standard; let val: f32 = StdRng::from_entropy().sample(Standard); println!("f32 from [0, 1): {}", val);
Floating point implementation
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).
Trait Implementations
impl Clone for Standard
[src]
impl Copy for Standard
[src]
impl Debug for Standard
[src]
impl<T> Distribution<[T; 0]> for Standard
[src]
pub fn sample<R>(&self, _rng: &mut R) -> [T; 0] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 1]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 1] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 10]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 10] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 11]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 11] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 12]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 12] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 13]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 13] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 14]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 14] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 15]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 15] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 16]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 16] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 17]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 17] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 18]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 18] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 19]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 19] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 2]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 2] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 20]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 20] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 21]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 21] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 22]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 22] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 23]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 23] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 24]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 24] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 25]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 25] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 26]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 26] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 27]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 27] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 28]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 28] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 29]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 29] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 3]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 3] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 30]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 30] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 31]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 31] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 32]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 32] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 4]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 4] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 5]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 5] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 6]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 6] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 7]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 7] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 8]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 8] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<[T; 9]> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, _rng: &mut R) -> [T; 9] where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<()> for Standard
[src]
pub fn sample<R>(&self, &mut R) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
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]
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>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B, C, D, E, F, G, H, I, J, K, L) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
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]
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>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B, C, D, E, F, G, H, I, J, K) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
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]
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>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B, C, D, E, F, G, H, I, J) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
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]
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>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B, C, D, E, F, G, H, I) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
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]
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
Standard: Distribution<F>,
Standard: Distribution<G>,
Standard: Distribution<H>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B, C, D, E, F, G, H) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
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]
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
Standard: Distribution<F>,
Standard: Distribution<G>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B, C, D, E, F, G) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
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]
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
Standard: Distribution<F>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B, C, D, E, F) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
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]
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
Standard: Distribution<E>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B, C, D, E) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
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]
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
Standard: Distribution<D>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B, C, D) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<A, B, C> Distribution<(A, B, C)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
[src]
Standard: Distribution<A>,
Standard: Distribution<B>,
Standard: Distribution<C>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B, C) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<A, B> Distribution<(A, B)> for Standard where
Standard: Distribution<A>,
Standard: Distribution<B>,
[src]
Standard: Distribution<A>,
Standard: Distribution<B>,
pub fn sample<R>(&self, _rng: &mut R) -> (A, B) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<A> Distribution<(A,)> for Standard where
Standard: Distribution<A>,
[src]
Standard: Distribution<A>,
pub fn sample<R>(&self, _rng: &mut R) -> (A,) where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<NonZeroU128> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> NonZeroU128 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<NonZeroU16> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> NonZeroU16 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<NonZeroU32> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> NonZeroU32 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<NonZeroU64> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> NonZeroU64 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<NonZeroU8> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> NonZeroU8 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<NonZeroUsize> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> NonZeroUsize where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<Option<T>> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, rng: &mut R) -> Option<T> where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl<T> Distribution<Wrapping<T>> for Standard where
Standard: Distribution<T>,
[src]
Standard: Distribution<T>,
pub fn sample<R>(&self, rng: &mut R) -> Wrapping<T> where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<bool> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> bool where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<char> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> char where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<f32> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> f32 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<f64> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> f64 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<i128> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> i128 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<i16> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> i16 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<i32> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> i32 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<i64> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> i64 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<i8> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> i8 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<isize> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> isize where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<u128> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> u128 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<u16> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> u16 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<u32> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> u32 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<u64> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> u64 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<u8> for Standard
[src]
pub fn sample<R>(&self, rng: &mut R) -> u8 where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
[src]
R: Rng,
impl Distribution<usize> for Standard
[src]
Auto Trait Implementations
impl RefUnwindSafe for Standard
impl Send for Standard
impl Sync for Standard
impl Unpin for Standard
impl UnwindSafe for Standard
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,