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>) -> AnimationPhase
pub fn clamp(self, range: RangeInclusive<f32>) -> AnimationPhase
Restricts this phase to the bounds of a range.
Sourcepub fn interpolate<T>(self, from: T, to: T) -> Twhere
T: Interpolate,
pub fn interpolate<T>(self, from: T, to: T) -> Twhere
T: Interpolate,
Interpolates between values using 0 and 1 as their phase coordinates.
Sourcepub fn interpolate_clamped<T>(self, from: T, to: T) -> Twhere
T: Interpolate,
pub fn interpolate_clamped<T>(self, from: T, to: T) -> Twhere
T: Interpolate,
Interpolates between values without extrapolating beyond 0 and 1.
Sourcepub fn interpolate_between<T>(
self,
range: RangeInclusive<f32>,
from: T,
to: T,
) -> Twhere
T: Interpolate,
pub fn interpolate_between<T>(
self,
range: RangeInclusive<f32>,
from: T,
to: T,
) -> Twhere
T: Interpolate,
Interpolates between values assigned to arbitrary phase coordinates.
Sourcepub fn interpolate_between_clamped<T>(
self,
range: RangeInclusive<f32>,
from: T,
to: T,
) -> Twhere
T: Interpolate,
pub fn interpolate_between_clamped<T>(
self,
range: RangeInclusive<f32>,
from: T,
to: T,
) -> Twhere
T: Interpolate,
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§fn from(value: bool) -> AnimationPhase
fn from(value: bool) -> AnimationPhase
Converts to this type from the input type.
Source§impl From<f32> for AnimationPhase
impl From<f32> for AnimationPhase
Source§fn from(value: f32) -> AnimationPhase
fn from(value: f32) -> AnimationPhase
Converts to this type from the input type.
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
Source§type Output = AnimationPhase
type Output = AnimationPhase
The value supplied to the spring animator.
Source§fn resolve(&self, value: f32) -> <AnimationPhase as SpringTarget>::Output
fn resolve(&self, value: f32) -> <AnimationPhase as SpringTarget>::Output
Projects a spring coordinate into the animated output.
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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().