Struct StandardUniform
pub struct StandardUniform;Expand description
The Standard Uniform distribution
This Distribution is the standard parameterization of Uniform. Bounds
are selected according to the output type.
Assuming the provided Rng is well-behaved, these implementations
generate values with the following ranges and distributions:
- Integers (
i8,i32,u64, etc.) are uniformly distributed over the whole range of the type (thus each possible value may be sampled with equal probability). charis 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. For some uses, theAlphanumericorAlphabeticdistribution will be more appropriate.boolsamplesfalseortrue, each with probability 0.5.- Floating point types (
f32andf64) are uniformly distributed in the half-open range[0, 1). See also the notes below. - Wrapping integers (
Wrapping<T>), besides the type identical to their normal integer variants. - Non-zero integers (
NonZeroU8), which are like their normal integer variants but cannot sample zero.
The StandardUniform distribution also supports generation of the following
compound types where all component types are supported:
- Tuples (up to 12 elements): each element is sampled sequentially and independently (thus, assuming a well-behaved RNG, there is no correlation between elements).
- Arrays
[T; n]whereTis supported. Each element is sampled sequentially and independently. Note that for smallTthis usually results in the RNG discarding random bits; see alsoRngExt::fillwhich offers a more efficient approach to filling an array of integer types with random data. - SIMD types (requires
simd_supportfeature) like x86’s__m128iandstd::simd’su32x4,f32x4andmask32x4types are effectively arrays of integer or floating-point types. Each lane is sampled independently, potentially with more efficient random-bit-usage (and a different resulting value) than would be achieved with sequential sampling (as with the array types above).
§Custom implementations
The StandardUniform distribution may be implemented for user types as follows:
use rand::{Rng, RngExt};
use rand::distr::{Distribution, StandardUniform};
struct MyF32 {
x: f32,
}
impl Distribution<MyF32> for StandardUniform {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> MyF32 {
MyF32 { x: rng.random() }
}
}§Example usage
use rand::prelude::*;
use rand::distr::StandardUniform;
let val: f32 = rand::rng().sample(StandardUniform);
println!("f32 from [0, 1): {}", val);§Floating point implementation
The floating point implementations for StandardUniform 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::random_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 StandardUniform
impl Clone for StandardUniform
§fn clone(&self) -> StandardUniform
fn clone(&self) -> StandardUniform
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for StandardUniform
impl Debug for StandardUniform
§impl Default for StandardUniform
impl Default for StandardUniform
§fn default() -> StandardUniform
fn default() -> StandardUniform
§impl<T, const N: usize> Distribution<[T; N]> for StandardUniformwhere
StandardUniform: Distribution<T>,
impl<T, const N: usize> Distribution<[T; N]> for StandardUniformwhere
StandardUniform: Distribution<T>,
§impl Distribution<()> for StandardUniform
impl Distribution<()> for StandardUniform
§impl<A> Distribution<(A,)> for StandardUniformwhere
StandardUniform: Distribution<A>,
impl<A> Distribution<(A,)> for StandardUniformwhere
StandardUniform: Distribution<A>,
§impl<A, B> Distribution<(A, B)> for StandardUniform
impl<A, B> Distribution<(A, B)> for StandardUniform
§impl<A, B, C> Distribution<(A, B, C)> for StandardUniform
impl<A, B, C> Distribution<(A, B, C)> for StandardUniform
§impl<A, B, C, D> Distribution<(A, B, C, D)> for StandardUniform
impl<A, B, C, D> Distribution<(A, B, C, D)> for StandardUniform
§fn sample<R>(&self, rng: &mut R) -> (A, B, C, D)
fn sample<R>(&self, rng: &mut R) -> (A, B, C, D)
T, using rng as the source of randomness.§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
T, using rng as
the source of randomness. Read more§impl<A, B, C, D, E> Distribution<(A, B, C, D, E)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E>,
impl<A, B, C, D, E> Distribution<(A, B, C, D, E)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E>,
§fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E)
fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E)
T, using rng as the source of randomness.§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
T, using rng as
the source of randomness. Read more§impl<A, B, C, D, E, F> Distribution<(A, B, C, D, E, F)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F>,
impl<A, B, C, D, E, F> Distribution<(A, B, C, D, E, F)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F>,
§fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F)
fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F)
T, using rng as the source of randomness.§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
T, using rng as
the source of randomness. Read more§impl<A, B, C, D, E, F, G> Distribution<(A, B, C, D, E, F, G)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G>,
impl<A, B, C, D, E, F, G> Distribution<(A, B, C, D, E, F, G)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G>,
§fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G)
fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G)
T, using rng as the source of randomness.§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
T, using rng as
the source of randomness. Read more§impl<A, B, C, D, E, F, G, H> Distribution<(A, B, C, D, E, F, G, H)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H>,
impl<A, B, C, D, E, F, G, H> Distribution<(A, B, C, D, E, F, G, H)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H>,
§fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G, H)
fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G, H)
T, using rng as the source of randomness.§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
T, using rng as
the source of randomness. Read more§impl<A, B, C, D, E, F, G, H, I> Distribution<(A, B, C, D, E, F, G, H, I)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I>,
impl<A, B, C, D, E, F, G, H, I> Distribution<(A, B, C, D, E, F, G, H, I)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I>,
§fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G, H, I)
fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G, H, I)
T, using rng as the source of randomness.§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
T, using rng as
the source of randomness. 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 StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I> + Distribution<J>,
impl<A, B, C, D, E, F, G, H, I, J> Distribution<(A, B, C, D, E, F, G, H, I, J)> for StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I> + Distribution<J>,
§fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G, H, I, J)
fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G, H, I, J)
T, using rng as the source of randomness.§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
T, using rng as
the source of randomness. 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 StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I> + Distribution<J> + Distribution<K>,
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 StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I> + Distribution<J> + Distribution<K>,
§fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G, H, I, J, K)
fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G, H, I, J, K)
T, using rng as the source of randomness.§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
T, using rng as
the source of randomness. 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 StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I> + Distribution<J> + Distribution<K> + Distribution<L>,
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 StandardUniformwhere
StandardUniform: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I> + Distribution<J> + Distribution<K> + Distribution<L>,
§fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G, H, I, J, K, L)
fn sample<R>(&self, rng: &mut R) -> (A, B, C, D, E, F, G, H, I, J, K, L)
T, using rng as the source of randomness.§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T> ⓘ
T, using rng as
the source of randomness. Read more§impl Distribution<NonZero<i128>> for StandardUniform
impl Distribution<NonZero<i128>> for StandardUniform
§impl Distribution<NonZero<i16>> for StandardUniform
impl Distribution<NonZero<i16>> for StandardUniform
§impl Distribution<NonZero<i32>> for StandardUniform
impl Distribution<NonZero<i32>> for StandardUniform
§impl Distribution<NonZero<i64>> for StandardUniform
impl Distribution<NonZero<i64>> for StandardUniform
§impl Distribution<NonZero<i8>> for StandardUniform
impl Distribution<NonZero<i8>> for StandardUniform
§impl Distribution<NonZero<u128>> for StandardUniform
impl Distribution<NonZero<u128>> for StandardUniform
§impl Distribution<NonZero<u16>> for StandardUniform
impl Distribution<NonZero<u16>> for StandardUniform
§impl Distribution<NonZero<u32>> for StandardUniform
impl Distribution<NonZero<u32>> for StandardUniform
§impl Distribution<NonZero<u64>> for StandardUniform
impl Distribution<NonZero<u64>> for StandardUniform
§impl Distribution<NonZero<u8>> for StandardUniform
impl Distribution<NonZero<u8>> for StandardUniform
§impl<T> Distribution<Wrapping<T>> for StandardUniformwhere
StandardUniform: Distribution<T>,
impl<T> Distribution<Wrapping<T>> for StandardUniformwhere
StandardUniform: Distribution<T>,
§impl Distribution<__m128i> for StandardUniform
Available on x86 or x86-64 only.
impl Distribution<__m128i> for StandardUniform
§impl Distribution<__m256i> for StandardUniform
Available on x86 or x86-64 only.
impl Distribution<__m256i> for StandardUniform
§impl Distribution<bool> for StandardUniform
impl Distribution<bool> for StandardUniform
§impl Distribution<char> for StandardUniform
impl Distribution<char> for StandardUniform
§impl Distribution<f32> for StandardUniform
impl Distribution<f32> for StandardUniform
§impl Distribution<f64> for StandardUniform
impl Distribution<f64> for StandardUniform
§impl Distribution<i128> for StandardUniform
impl Distribution<i128> for StandardUniform
§impl Distribution<i16> for StandardUniform
impl Distribution<i16> for StandardUniform
§impl Distribution<i32> for StandardUniform
impl Distribution<i32> for StandardUniform
§impl Distribution<i64> for StandardUniform
impl Distribution<i64> for StandardUniform
§impl Distribution<i8> for StandardUniform
impl Distribution<i8> for StandardUniform
§impl Distribution<u128> for StandardUniform
impl Distribution<u128> for StandardUniform
§impl Distribution<u16> for StandardUniform
impl Distribution<u16> for StandardUniform
§impl Distribution<u32> for StandardUniform
impl Distribution<u32> for StandardUniform
§impl Distribution<u64> for StandardUniform
impl Distribution<u64> for StandardUniform
§impl Distribution<u8> for StandardUniform
impl Distribution<u8> for StandardUniform
§impl SampleString for StandardUniform
Available on crate feature alloc only.
impl SampleString for StandardUniform
alloc only.impl Copy for StandardUniform
Auto Trait Implementations§
impl Freeze for StandardUniform
impl RefUnwindSafe for StandardUniform
impl Send for StandardUniform
impl Sync for StandardUniform
impl Unpin for StandardUniform
impl UnsafeUnpin for StandardUniform
impl UnwindSafe for StandardUniform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.