Struct valence::rand::distributions::Standard
source · pub struct Standard;
Expand description
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 and float types and tends to be faster foru32
and smaller types. When usingrustc
≥ 1.51, enable themin_const_gen
feature to support arrays larger than 32 elements. Note thatRng::fill
andStandard
’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 byStandard
. 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§
source§impl DistString for Standard
impl DistString for Standard
Note: the String
is potentially left with excess capacity; optionally the
user may call string.shrink_to_fit()
afterwards.
source§impl<T> Distribution<[T; 32]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 32]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 31]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 31]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 30]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 30]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 29]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 29]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 28]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 28]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 27]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 27]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 26]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 26]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 25]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 25]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 24]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 24]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 23]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 23]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 22]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 22]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 21]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 21]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 20]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 20]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 19]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 19]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 18]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 18]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 17]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 17]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 16]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 16]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 15]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 15]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 14]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 14]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 13]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 13]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 12]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 12]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 11]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 11]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 10]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 10]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 9]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 9]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 8]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 8]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 7]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 7]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 6]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 6]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 5]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 5]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 4]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 4]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 3]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 3]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 2]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 2]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 1]> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<[T; 1]> for Standardwhere
Standard: Distribution<T>,
source§impl<T> Distribution<[T; 0]> for Standard
impl<T> Distribution<[T; 0]> for Standard
source§impl Distribution<()> for Standard
impl Distribution<()> for Standard
source§impl<A> Distribution<(A,)> for Standardwhere
Standard: Distribution<A>,
impl<A> Distribution<(A,)> for Standardwhere
Standard: Distribution<A>,
source§impl<A, B> Distribution<(A, B)> for Standard
impl<A, B> Distribution<(A, B)> for Standard
source§impl<A, B, C> Distribution<(A, B, C)> for Standard
impl<A, B, C> Distribution<(A, B, C)> for Standard
source§impl<A, B, C, D> Distribution<(A, B, C, D)> for Standard
impl<A, B, C, D> Distribution<(A, B, C, D)> for Standard
source§impl<A, B, C, D, E> Distribution<(A, B, C, D, E)> for Standardwhere
Standard: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E>,
impl<A, B, C, D, E> Distribution<(A, B, C, D, E)> for Standardwhere
Standard: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E>,
source§impl<A, B, C, D, E, F> Distribution<(A, B, C, D, E, F)> for Standardwhere
Standard: 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 Standardwhere
Standard: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F>,
source§impl<A, B, C, D, E, F, G> Distribution<(A, B, C, D, E, F, G)> for Standardwhere
Standard: 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 Standardwhere
Standard: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G>,
source§impl<A, B, C, D, E, F, G, H> Distribution<(A, B, C, D, E, F, G, H)> for Standardwhere
Standard: 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 Standardwhere
Standard: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H>,
source§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.source§impl<A, B, C, D, E, F, G, H, I> Distribution<(A, B, C, D, E, F, G, H, I)> for Standardwhere
Standard: 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 Standardwhere
Standard: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I>,
source§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.source§impl<A, B, C, D, E, F, G, H, I, J> Distribution<(A, B, C, D, E, F, G, H, I, J)> for Standardwhere
Standard: 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 Standardwhere
Standard: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I> + Distribution<J>,
source§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.source§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 Standardwhere
Standard: 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 Standardwhere
Standard: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I> + Distribution<J> + Distribution<K>,
source§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.source§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 Standardwhere
Standard: 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 Standardwhere
Standard: Distribution<A> + Distribution<B> + Distribution<C> + Distribution<D> + Distribution<E> + Distribution<F> + Distribution<G> + Distribution<H> + Distribution<I> + Distribution<J> + Distribution<K> + Distribution<L>,
source§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.source§impl Distribution<DMat2> for Standard
impl Distribution<DMat2> for Standard
source§impl Distribution<DMat3> for Standard
impl Distribution<DMat3> for Standard
source§impl Distribution<DMat4> for Standard
impl Distribution<DMat4> for Standard
source§impl Distribution<DQuat> for Standard
impl Distribution<DQuat> for Standard
source§impl Distribution<DVec2> for Standard
impl Distribution<DVec2> for Standard
source§impl Distribution<DVec3> for Standard
impl Distribution<DVec3> for Standard
source§impl Distribution<DVec4> for Standard
impl Distribution<DVec4> for Standard
source§impl Distribution<I16Vec2> for Standard
impl Distribution<I16Vec2> for Standard
source§impl Distribution<I16Vec3> for Standard
impl Distribution<I16Vec3> for Standard
source§impl Distribution<I16Vec4> for Standard
impl Distribution<I16Vec4> for Standard
source§impl Distribution<I64Vec2> for Standard
impl Distribution<I64Vec2> for Standard
source§impl Distribution<I64Vec3> for Standard
impl Distribution<I64Vec3> for Standard
source§impl Distribution<I64Vec4> for Standard
impl Distribution<I64Vec4> for Standard
source§impl Distribution<IVec2> for Standard
impl Distribution<IVec2> for Standard
source§impl Distribution<IVec3> for Standard
impl Distribution<IVec3> for Standard
source§impl Distribution<IVec4> for Standard
impl Distribution<IVec4> for Standard
source§impl Distribution<Mat2> for Standard
impl Distribution<Mat2> for Standard
source§impl Distribution<Mat3> for Standard
impl Distribution<Mat3> for Standard
source§impl Distribution<Mat4> for Standard
impl Distribution<Mat4> for Standard
source§impl Distribution<NonZero<u128>> for Standard
impl Distribution<NonZero<u128>> for Standard
source§impl Distribution<NonZero<u16>> for Standard
impl Distribution<NonZero<u16>> for Standard
source§impl Distribution<NonZero<u32>> for Standard
impl Distribution<NonZero<u32>> for Standard
source§impl Distribution<NonZero<u64>> for Standard
impl Distribution<NonZero<u64>> for Standard
source§impl Distribution<NonZero<u8>> for Standard
impl Distribution<NonZero<u8>> for Standard
source§impl Distribution<NonZero<usize>> for Standard
impl Distribution<NonZero<usize>> for Standard
source§impl<T> Distribution<Option<T>> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<Option<T>> for Standardwhere
Standard: Distribution<T>,
source§impl Distribution<Quat> for Standard
impl Distribution<Quat> for Standard
source§impl Distribution<U16Vec2> for Standard
impl Distribution<U16Vec2> for Standard
source§impl Distribution<U16Vec3> for Standard
impl Distribution<U16Vec3> for Standard
source§impl Distribution<U16Vec4> for Standard
impl Distribution<U16Vec4> for Standard
source§impl Distribution<U64Vec2> for Standard
impl Distribution<U64Vec2> for Standard
source§impl Distribution<U64Vec3> for Standard
impl Distribution<U64Vec3> for Standard
source§impl Distribution<U64Vec4> for Standard
impl Distribution<U64Vec4> for Standard
source§impl Distribution<UVec2> for Standard
impl Distribution<UVec2> for Standard
source§impl Distribution<UVec3> for Standard
impl Distribution<UVec3> for Standard
source§impl Distribution<UVec4> for Standard
impl Distribution<UVec4> for Standard
source§impl Distribution<Vec2> for Standard
impl Distribution<Vec2> for Standard
source§impl Distribution<Vec3> for Standard
impl Distribution<Vec3> for Standard
source§impl Distribution<Vec3A> for Standard
impl Distribution<Vec3A> for Standard
source§impl Distribution<Vec4> for Standard
impl Distribution<Vec4> for Standard
source§impl<T> Distribution<Wrapping<T>> for Standardwhere
Standard: Distribution<T>,
impl<T> Distribution<Wrapping<T>> for Standardwhere
Standard: Distribution<T>,
source§impl Distribution<bool> for Standard
impl Distribution<bool> for Standard
source§impl Distribution<char> for Standard
impl Distribution<char> for Standard
source§impl Distribution<f32> for Standard
impl Distribution<f32> for Standard
source§impl Distribution<f64> for Standard
impl Distribution<f64> for Standard
source§impl Distribution<i128> for Standard
impl Distribution<i128> for Standard
source§impl Distribution<i16> for Standard
impl Distribution<i16> for Standard
source§impl Distribution<i32> for Standard
impl Distribution<i32> for Standard
source§impl Distribution<i64> for Standard
impl Distribution<i64> for Standard
source§impl Distribution<i8> for Standard
impl Distribution<i8> for Standard
source§impl Distribution<isize> for Standard
impl Distribution<isize> for Standard
source§impl Distribution<u128> for Standard
impl Distribution<u128> for Standard
source§impl Distribution<u16> for Standard
impl Distribution<u16> for Standard
source§impl Distribution<u32> for Standard
impl Distribution<u32> for Standard
source§impl Distribution<u64> for Standard
impl Distribution<u64> for Standard
source§impl Distribution<u8> for Standard
impl Distribution<u8> for Standard
source§impl Distribution<usize> for Standard
impl Distribution<usize> for Standard
impl Copy for Standard
Auto Trait Implementations§
impl Freeze for Standard
impl RefUnwindSafe for Standard
impl Send for Standard
impl Sync for Standard
impl Unpin for Standard
impl UnwindSafe for Standard
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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>
. Box<dyn Any>
can
then be further downcast
into Box<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>
. Rc<Any>
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> DowncastSync for T
impl<T> DowncastSync 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> 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> 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> 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.