Enum Easing

Source
pub enum Easing {
Show 30 variants Linear, Ease, In, Out, InOut, InSine, OutSine, InOutSine, InQuad, OutQuad, InOutQuad, InCubic, OutCubic, InOutCubic, InQuart, OutQuart, InOutQuart, InQuint, OutQuint, InOutQuint, InExpo, OutExpo, InOutExpo, InCirc, OutCirc, InOutCirc, InBack, OutBack, InOutBack, Custom(Box<dyn EasingFunction>),
}
Expand description

Specifies a standard or custom EasingFunction.

Available easings include:

  • CSS standard: Ease, In, Out, InOut corresponding to ease, ease-in, ease-out and ease-in-out
  • Common easings that can be implemented with a cubic bezier function, i.e. the majority of functions listed on https://easings.net except for the “elastic” and “bounce” types.
  • User-defined functions via Custom.

Variants§

§

Linear

Linear easing, i.e. no easing or curve, only straight-line interpolation.

§

Ease

Curve equivalent to CSS ease.

§

In

Curve equivalent to CSS ease-in.

§

Out

Curve equivalent to CSS ease-out.

§

InOut

Curve equivalent to CSS ease-in-out.

§

InSine

Sinusoidal easing that starts slowly and ends quickly. Subtle, almost linear curve.

See: https://easings.net/#easeInSine

§

OutSine

Sinusoidal easing that starts quickly and ends slowly. Subtle, almost linear curve.

See: https://easings.net/#easeOutSine

§

InOutSine

Sinusoidal easing that starts slowly, speeds up, and then ends slowly. Subtle, almost linear curve.

See: https://easings.net/#easeInOutSine

§

InQuad

Quadratic (^2) easing that starts slowly and ends quickly. Slightly steeper curve than InSine.

See: https://easings.net/#easeInQuad

§

OutQuad

Quadratic (^2) easing that starts quickly and ends slowly. Slightly steeper curve than OutSine.

See: https://easings.net/#easeOutQuad

§

InOutQuad

Quadratic (^2) easing that starts slowly, speeds up, and then ends slowly. Slightly steeper curve than InOutSine.

See: https://easings.net/#easeInOutQuad

§

InCubic

Cubic (^3) easing that starts slowly and ends quickly. Slightly steeper curve than InQuad.

See: https://easings.net/#easeInCubic

§

OutCubic

Cubic (^3) easing that starts quickly and ends slowly. Slightly steeper curve than OutQuad.

See: https://easings.net/#easeOutCubic

§

InOutCubic

Cubic (^3) easing that starts slowly, speeds up, and then ends slowly. Slightly steeper curve than InOutQuad.

See: https://easings.net/#easeInOutCubic

§

InQuart

Quartic (^4) easing that starts slowly and ends quickly. Slightly steeper curve than InCubic.

See: https://easings.net/#easeInQuart

§

OutQuart

Quartic (^4) easing that starts quickly and ends slowly. Slightly steeper curve than OutCubic.

See: https://easings.net/#easeOutQuart

§

InOutQuart

Quartic (^4) easing that starts slowly, speeds up, and then ends slowly. Slightly steeper curve than InOutCubic.

See: https://easings.net/#easeInOutQuart

§

InQuint

Quintic (^5) easing that starts slowly and ends quickly. Slightly steeper curve than InQuart.

See: https://easings.net/#easeInQuint

§

OutQuint

Quintic (^5) easing that starts quickly and ends slowly. Slightly steeper curve than OutQuart.

See: https://easings.net/#easeOutQuint

§

InOutQuint

Quintic (^5) easing that starts slowly, speeds up, and then ends slowly. Slightly steeper curve than InOutQuart.

See: https://easings.net/#easeInOutQuint

§

InExpo

Exponential easing that starts slowly and ends quickly. Steeper curve than InQuint and generally only suitable for long animations/frames.

See: https://easings.net/#easeInExpo

§

OutExpo

Exponential easing that starts quickly and ends slowly. Steeper curve than OutQuint and generally only suitable for long animations/frames.

See: https://easings.net/#easeOutExpo

§

InOutExpo

Exponential easing that starts slowly, speeds up, and then ends slowly. Steeper curve than InOutQuint and generally only suitable for long animations/frames.

See: https://easings.net/#easeInOutExpo

§

InCirc

A curve that looks like the lower-right quarter of a circle. Starts slowly, and speeds up dramatically. Generally only suitable for long animations/frames.

See: https://easings.net/#easeInCirc

§

OutCirc

A curve that looks like the upper-left quarter of a circle. Starts very quickly, and decelerates dramatically. Generally only suitable for long animations/frames.

See: https://easings.net/#easeOutCirc

§

InOutCirc

A curve that looks like the lower-right quarter of a circle connected to the upper-left quarter of a circle. Starts very slowly, accelerates dramatically, and ends very slowly. dramatically. Generally only suitable for long animations/frames.

See: https://easings.net/#easeInOutCirc

§

InBack

A curve that has similar timing to InExpo but moves slightly backward (negative) before accelerating forward.

See: https://easings.net/#easeInBack

§

OutBack

A curve that has similar timing to OutExpo but overshoots the terminal value (i.e. goes above 1.0) before decelerating backward and settling at the final value.

See: https://easings.net/#easeOutBack

§

InOutBack

A curve that has similar timing to InOutExpo but moves slightly backward (negative) before accelerating forward and also overshoots the terminal value (i.e. goes above 1.0) before decelerating backward and settling at the final value.

See: https://easings.net/#easeInOutBack

§

Custom(Box<dyn EasingFunction>)

User-defined easing, such as an ad-hoc CubicBezierEasing.

Trait Implementations§

Source§

impl Clone for Easing

Source§

fn clone(&self) -> Easing

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Easing

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Easing

Source§

fn default() -> Easing

Returns the “default value” for a type. Read more
Source§

impl EasingFunction for Easing

Source§

fn calc(&self, x: f32) -> f32

Computes the y value along the curve for a given x position. Read more

Auto Trait Implementations§

§

impl Freeze for Easing

§

impl !RefUnwindSafe for Easing

§

impl Send for Easing

§

impl Sync for Easing

§

impl Unpin for Easing

§

impl !UnwindSafe for Easing

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.