pub struct Motion<Description = DurationDescription> { /* private fields */ }Expand description
A deterministic, time-sampled motion from a start value to a target.
Motion describes how a value moves over time, and it doesn’t hold the value. It is either
duration-based (the default) or spring-based, depending on Description. Call
Motion::sample with the time since the run started to get the progress and the
lifecycle state at that moment.
A duration motion has one forward MotionPass, an optional reverse pass, an initial
delay, and a Playback policy. The default is one forward iteration with no delay. The
delay applies once, when a run begins.
Motion::iterations counts total iterations, including the first. Restarting motion
begins each iteration with local time at zero. Motion::alternate starts forward, then
uses a backward leg on every second iteration. Direction::AlternateReverse starts
backward instead. With conventional easing endpoints, forward-first alternating motion rests
at its target after an odd count and at its origin after an even count. Reverse-first
alternating motion has the opposite endpoints. Custom easing endpoints may settle elsewhere,
including outside zero through one.
A backward leg uses the configured reverse pass, or reuses the forward pass’s duration and
easing if no reverse pass is configured. Reverse local time still advances from zero to one
and is eased in that direction. The resulting presentation progress is 1 - eased. For
example, reverse ease-in starts the backward leg slowly and accelerates toward the origin.
Local pass time is normalized. Eased presentation may overshoot, as in upstream spring easing, while pass selection remains deterministic. Finite zero-duration motion resolves immediately once its initial delay is satisfied, with the configured direction and iteration parity determining the final presentation. A zero-length leg in otherwise nonzero alternating motion is instantaneous. Indefinite motion whose applicable passes all have zero duration becomes inactive instead of requesting animation frames forever.
§Examples
Ease a one-pass motion. At a quarter of the way through, ease_in_out gives 0.125.
use gpui::{Motion, ease_in_out, millis};
let motion = Motion::new(millis(200)).with_easing(ease_in_out);
assert_eq!(motion.sample(millis(50)).progress.get(), 0.125);
assert!(motion.sample(millis(200)).is_at_end());Restart the pass three times. Each iteration begins again from zero.
use gpui::{Motion, millis};
let motion = Motion::new(millis(1000)).iterations(3);
let sample = motion.sample(millis(2500));
assert_eq!(sample.iteration, 2);
assert_eq!(sample.local_time.get(), 0.5);
assert!(motion.sample(millis(3000)).is_complete());Alternate the direction. After an even number of iterations the motion rests at its origin.
use gpui::{Motion, Progress, millis};
let motion = Motion::new(millis(1000)).iterations(2).alternate();
assert_eq!(motion.sample(millis(1500)).progress.get(), 0.5);
assert_eq!(motion.sample(millis(2000)).progress, Progress::START);Implementations§
Source§impl Motion<DurationDescription>
impl Motion<DurationDescription>
Sourcepub fn new(duration: Duration) -> Self
pub fn new(duration: Duration) -> Self
Creates a one-pass linear motion of duration, with no delay, run once.
Sourcepub fn with_easing(self, easing: impl Fn(f32) -> f32 + 'static) -> Self
pub fn with_easing(self, easing: impl Fn(f32) -> f32 + 'static) -> Self
Sets the easing of the forward pass.
An alternating motion without an explicit reverse pass uses this easing for its backward legs too.
Sourcepub fn with_spring(self, config: SpringConfig) -> Self
pub fn with_spring(self, config: SpringConfig) -> Self
Replaces the easing with a spring sampled over this motion’s duration.
The spring starts at rest and reaches its target at the end of the duration. It doesn’t
settle on its own and it doesn’t keep velocity across retargets. For a spring that settles
and keeps its velocity, use Motion::spring.
Sourcepub fn with_forward_pass(self, pass: MotionPass) -> Self
pub fn with_forward_pass(self, pass: MotionPass) -> Self
Replaces the forward pass, including its duration and easing.
Sourcepub fn with_reverse_pass(self, pass: MotionPass) -> Self
pub fn with_reverse_pass(self, pass: MotionPass) -> Self
Sets the pass used for backward legs.
This doesn’t infer direction from changes to an Animated target. A
newly retargeted run begins with its configured direction. Without an explicit reverse
pass, backward legs reuse the forward pass’s duration and easing.
Reverse local time advances from zero to one and is eased normally. Its presentation is
then mapped as 1 - eased, so a reverse ease-in begins slowly and accelerates toward the
origin.
Sourcepub fn with_delay(self, delay: Duration) -> Self
pub fn with_delay(self, delay: Duration) -> Self
Delays the start of the run by delay.
The delay applies once, before the first iteration. Restarted iterations don’t wait again. During the delay, the progress is the start value of the run.
Sourcepub fn iterations(self, iterations: u32) -> Self
pub fn iterations(self, iterations: u32) -> Self
Sets the total number of iterations, including the first.
The default is one. Each iteration restarts local timing. In forward-first alternating motion, odd-numbered iterations are forward and even-numbered iterations are backward. With conventional easing endpoints, counts of one and three rest at the target, and counts of two and four rest at the origin.
§Panics
Panics if iterations is zero.
Sourcepub fn repeat_forever(self) -> Self
pub fn repeat_forever(self) -> Self
Repeats this motion without end.
Each iteration restarts from the start unless the motion alternates. A motion whose
applicable passes all have zero duration becomes MotionPhase::Inactive, resting at a
deterministic presentation.
Sourcepub fn alternate(self) -> Self
pub fn alternate(self) -> Self
Alternates the direction of successive iterations.
Odd-numbered iterations use the forward pass. Even-numbered iterations use the reverse
pass, or the forward pass when none is configured. This is the same as
direction(Direction::Alternate).
Sourcepub fn direction(self, direction: Direction) -> Self
pub fn direction(self, direction: Direction) -> Self
Sets the direction of successive iterations.
Sourcepub fn with_playback(self, playback: Playback) -> Self
pub fn with_playback(self, playback: Playback) -> Self
Replaces the whole playback policy: iterations and direction.
Sourcepub fn forward_pass(&self) -> &MotionPass
pub fn forward_pass(&self) -> &MotionPass
Returns the forward pass.
Sourcepub fn reverse_pass(&self) -> Option<&MotionPass>
pub fn reverse_pass(&self) -> Option<&MotionPass>
Returns the reverse pass, or None when backward legs reuse the forward pass.
Sourcepub const fn playback(&self) -> Playback
pub const fn playback(&self) -> Playback
Returns the iteration count and direction of this motion.
Sourcepub fn checked_extent(&self) -> Option<MotionExtent>
pub fn checked_extent(&self) -> Option<MotionExtent>
Returns the total length of the run, including the delay.
Returns MotionExtent::Infinite for Motion::repeat_forever. Returns None only when
a finite total is too large for Duration.
§Examples
use gpui::{Motion, MotionExtent, millis};
let motion = Motion::new(millis(300)).with_delay(millis(200)).iterations(3);
assert_eq!(motion.checked_extent(), Some(MotionExtent::Finite(millis(1100))));Sourcepub fn sample(&self, elapsed: Duration) -> MotionSample
pub fn sample(&self, elapsed: Duration) -> MotionSample
Samples this motion at elapsed, measured from the start of the run.
Before the delay ends, the phase is MotionPhase::Delayed. After the last iteration of
a finite run, it is MotionPhase::Completed at the final progress. Pass selection,
iteration parity and completion use integer nanosecond arithmetic. Only the fraction
within the selected pass is converted to a float for easing.
Sourcepub fn sample_at<Time>(&self, started_at: Time, now: Time) -> MotionSample
pub fn sample_at<Time>(&self, started_at: Time, now: Time) -> MotionSample
Samples this motion at now, given the time started_at when the run began.
Time can be any type that subtracts to a Duration, such as
std::time::Instant or the executor’s clock.
Source§impl Motion<SpringDescription>
impl Motion<SpringDescription>
Sourcepub fn spring(config: SpringConfig) -> Self
pub fn spring(config: SpringConfig) -> Self
Creates a spring that runs until it settles.
Give the spring a target with Motion::to. The settling tolerance defaults to 0.001.
Change it with Motion::with_epsilon.
Sourcepub fn config(&self) -> SpringConfig
pub fn config(&self) -> SpringConfig
Returns the physical parameters of this spring.
Sourcepub fn with_epsilon(self, epsilon: f32) -> Self
pub fn with_epsilon(self, epsilon: f32) -> Self
Sets how close the spring must be to its target before it counts as settled.
The tolerance applies to position, and to velocity scaled by the spring’s natural frequency.
Changing it also recomputes the settling time, which is when Motion::sample reports
MotionPhase::Completed.
Sourcepub fn sample(&self, elapsed: Duration) -> MotionSample
pub fn sample(&self, elapsed: Duration) -> MotionSample
Samples this spring at elapsed, starting from rest at zero progress.
Progress is the spring’s position, which overshoots when the spring is underdamped. From
the settling time onward the sample is MotionPhase::Completed at Progress::END,
and it is no longer active.
§Examples
use gpui::{Motion, Progress, millis, secs, spring};
let motion = Motion::spring(spring(100., 10., 1.));
assert!(motion.sample(millis(0)).is_active);
let settled = motion.sample(secs(10));
assert!(settled.is_complete());
assert_eq!(settled.progress, Progress::END);Sourcepub fn to<T: SpringTarget>(self, target: T) -> SpringAnimation<T>
pub fn to<T: SpringTarget>(self, target: T) -> SpringAnimation<T>
Targets target with this spring.
The result is a SpringAnimation for AnimationExt::with_spring.
Trait Implementations§
Source§impl Default for Motion<DurationDescription>
impl Default for Motion<DurationDescription>
Source§impl From<&Motion<SpringDescription>> for AnyMotion
impl From<&Motion<SpringDescription>> for AnyMotion
Source§fn from(motion: &Motion<SpringDescription>) -> Self
fn from(motion: &Motion<SpringDescription>) -> Self
Source§impl From<&Motion> for AnyMotion
impl From<&Motion> for AnyMotion
Source§fn from(motion: &Motion<DurationDescription>) -> Self
fn from(motion: &Motion<DurationDescription>) -> Self
Source§impl From<Motion<SpringDescription>> for AnyMotion
impl From<Motion<SpringDescription>> for AnyMotion
Source§fn from(motion: Motion<SpringDescription>) -> Self
fn from(motion: Motion<SpringDescription>) -> Self
Source§impl From<Motion> for AnyMotion
impl From<Motion> for AnyMotion
Source§fn from(motion: Motion<DurationDescription>) -> Self
fn from(motion: Motion<DurationDescription>) -> Self
Source§impl From<SpringConfig> for Motion<SpringDescription>
impl From<SpringConfig> for Motion<SpringDescription>
Source§fn from(config: SpringConfig) -> Self
fn from(config: SpringConfig) -> Self
Auto Trait Implementations§
impl<Description> Freeze for Motion<Description>where
Description: Freeze,
impl<Description> RefUnwindSafe for Motion<Description>where
Description: RefUnwindSafe,
impl<Description> Send for Motion<Description>where
Description: Send,
impl<Description> Sync for Motion<Description>where
Description: Sync,
impl<Description> Unpin for Motion<Description>where
Description: Unpin,
impl<Description> UnsafeUnpin for Motion<Description>where
Description: UnsafeUnpin,
impl<Description> UnwindSafe for Motion<Description>where
Description: UnwindSafe,
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
replaced by palette::chromatic_adaptation::AdaptIntoUnclamped
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
replaced by palette::chromatic_adaptation::AdaptIntoUnclamped
Source§impl<T, C> AdaptIntoUnclamped<T> for Cwhere
T: AdaptFromUnclamped<C>,
impl<T, C> AdaptIntoUnclamped<T> for Cwhere
T: AdaptFromUnclamped<C>,
Source§type Scalar = <T as AdaptFromUnclamped<C>>::Scalar
type Scalar = <T as AdaptFromUnclamped<C>>::Scalar
Source§fn adapt_into_unclamped_with<M>(self) -> Twhere
M: LmsToXyz<<C as AdaptIntoUnclamped<T>>::Scalar> + XyzToLms<<C as AdaptIntoUnclamped<T>>::Scalar>,
fn adapt_into_unclamped_with<M>(self) -> Twhere
M: LmsToXyz<<C as AdaptIntoUnclamped<T>>::Scalar> + XyzToLms<<C as AdaptIntoUnclamped<T>>::Scalar>,
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Source§impl<T, C> ComponentsInto<C> for T
impl<T, C> ComponentsInto<C> for T
Source§fn components_into(self) -> C
fn components_into(self) -> C
impl<T> CryptoRng for T
impl<R> CryptoRng for R
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
Source§fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Renamed to random to avoid conflict with the new gen keyword in Rust 2024.
Rng::random.Source§fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Renamed to random_range
Rng::random_range.impl<R> RngCore for Rwhere
R: Rng,
Source§impl<R> RngExt for R
impl<R> RngExt for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
impl<R> TryCryptoRng for R
impl<R> TryCryptoRng for R
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read moreSource§impl<R> TryRng for R
impl<R> TryRng for R
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
UnwrapMut wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self> ⓘwhere
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self> ⓘwhere
Self: Sized,
RngCore to a RngReadAdapter.