Easing
struct · ferroui-base · v0.5.0
struct Easing
An easing function: the shared, type-erased handle that animations and transitions hold.
Any IEasing converts into an Easing (LinearEasing::new().into()).
To keep mutating an easing after handing it out (for example the control
points of a SplineEasing), create it behind an Rc and use
from_rc. Handles compare by identity.
Members
new
fn new(easing: impl IEasing) -> Self
Wraps an easing function.
from_rc
fn from_rc(easing: Rc<dyn IEasing>) -> Self
Wraps a shared easing function.
as_rc
fn as_rc(self: &Self) -> &Rc<dyn IEasing>
The wrapped easing function.
ease
fn ease(self: &Self, progress: f64) -> f64
Returns the transformed progress for a linear progress.
parse
fn parse(e: &str) -> Result<Easing, FormatError>
Parses an easing: either the four comma-separated control points of a spline easing, or the name of one of the easing types of this module.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneIEasingDefaultPartialEqDebugFromStrFrom<BackEaseIn>From<BackEaseInOut>From<BackEaseOut>From<BounceEaseIn>From<BounceEaseInOut>From<BounceEaseOut>From<CircularEaseIn>From<CircularEaseInOut>From<CircularEaseOut>From<CubicEaseIn>From<CubicEaseInOut>From<CubicEaseOut>From<ElasticEaseIn>From<ElasticEaseInOut>From<ElasticEaseOut>From<ExponentialEaseIn>From<ExponentialEaseInOut>From<ExponentialEaseOut>From<LinearEasing>From<QuadraticEaseIn>From<QuadraticEaseInOut>From<QuadraticEaseOut>From<QuarticEaseIn>From<QuarticEaseInOut>From<QuarticEaseOut>From<QuinticEaseIn>From<QuinticEaseInOut>From<QuinticEaseOut>From<SineEaseIn>From<SineEaseInOut>From<SineEaseOut>From<SplineEasing>From<SpringEasing>From<CubicBezierEasingFunction>From<Rc<CubicBezierEasingFunction>>From<LinearEasingFunction>From<Rc<LinearEasingFunction>>From<StepEasingFunction>From<Rc<StepEasingFunction>>From<BackEasingFunction>From<Rc<BackEasingFunction>>From<BounceEasingFunction>From<Rc<BounceEasingFunction>>From<CircleEasingFunction>From<Rc<CircleEasingFunction>>From<ElasticEasingFunction>From<Rc<ElasticEasingFunction>>From<ExponentialEasingFunction>From<Rc<ExponentialEasingFunction>>From<PowerEasingFunction>From<Rc<PowerEasingFunction>>From<SineEasingFunction>From<Rc<SineEasingFunction>>MarkupTyped
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.