pub struct AnimationPhase(pub f32);Expand description
A potentially overshooting coordinate within an animation.
Phases are not restricted to 0..1. Multi-stage animations can assign each stage its own coordinate and interpolate over ranges such as 1..=2.
Tuple Fields§
§0: f32The unbounded phase coordinate.
Implementations§
Source§impl AnimationPhase
impl AnimationPhase
Sourcepub fn clamp(self, range: RangeInclusive<f32>) -> Self
pub fn clamp(self, range: RangeInclusive<f32>) -> Self
Restricts this phase to the bounds of a range.
Sourcepub fn interpolate<T: Interpolate>(self, from: T, to: T) -> T
pub fn interpolate<T: Interpolate>(self, from: T, to: T) -> T
Interpolates between values using 0 and 1 as their phase coordinates.
Sourcepub fn interpolate_clamped<T: Interpolate>(self, from: T, to: T) -> T
pub fn interpolate_clamped<T: Interpolate>(self, from: T, to: T) -> T
Interpolates between values without extrapolating beyond 0 and 1.
Sourcepub fn interpolate_between<T: Interpolate>(
self,
range: RangeInclusive<f32>,
from: T,
to: T,
) -> T
pub fn interpolate_between<T: Interpolate>( self, range: RangeInclusive<f32>, from: T, to: T, ) -> T
Interpolates between values assigned to arbitrary phase coordinates.
Sourcepub fn interpolate_between_clamped<T: Interpolate>(
self,
range: RangeInclusive<f32>,
from: T,
to: T,
) -> T
pub fn interpolate_between_clamped<T: Interpolate>( self, range: RangeInclusive<f32>, from: T, to: T, ) -> T
Interpolates over arbitrary phase coordinates without extrapolating.
Trait Implementations§
Source§impl Clone for AnimationPhase
impl Clone for AnimationPhase
Source§fn clone(&self) -> AnimationPhase
fn clone(&self) -> AnimationPhase
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AnimationPhase
Source§impl Debug for AnimationPhase
impl Debug for AnimationPhase
Source§impl Default for AnimationPhase
impl Default for AnimationPhase
Source§fn default() -> AnimationPhase
fn default() -> AnimationPhase
Returns the “default value” for a type. Read more
Source§impl From<bool> for AnimationPhase
impl From<bool> for AnimationPhase
Source§impl From<f32> for AnimationPhase
impl From<f32> for AnimationPhase
Source§impl PartialEq for AnimationPhase
impl PartialEq for AnimationPhase
Source§impl PartialOrd for AnimationPhase
impl PartialOrd for AnimationPhase
Source§impl SpringTarget for AnimationPhase
impl SpringTarget for AnimationPhase
impl StructuralPartialEq for AnimationPhase
Auto Trait Implementations§
impl Freeze for AnimationPhase
impl RefUnwindSafe for AnimationPhase
impl Send for AnimationPhase
impl Sync for AnimationPhase
impl Unpin for AnimationPhase
impl UnsafeUnpin for AnimationPhase
impl UnwindSafe for AnimationPhase
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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> ⓘ
Converts
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> ⓘ
Converts
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> Pointable for T
impl<T> Pointable for T
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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().