Struct easing_function::EasingFunction

source ·
pub struct EasingFunction(/* private fields */);
Expand description

An easing function for customizing animations.

Implementations§

source§

impl EasingFunction

source

pub fn from_fn(func: fn(_: f32) -> f32) -> Self

Returns a new easing function using func.

source

pub fn new<Easing>(easing: Easing) -> Self
where Easing: Easing + Debug + Clone,

Returns a new easing function using easing.

Trait Implementations§

source§

impl Clone for EasingFunction

source§

fn clone(&self) -> EasingFunction

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for EasingFunction

source§

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

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

impl Default for EasingFunction

source§

fn default() -> Self

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

impl Easing for EasingFunction

source§

fn ease(&self, progress: f32) -> f32

Eases a value ranging between zero and one. The resulting value does not need to be bounded between zero and one.
source§

impl From<EaseInBack> for EasingFunction

source§

fn from(_function: EaseInBack) -> Self

Converts to this type from the input type.
source§

impl From<EaseInBounce> for EasingFunction

source§

fn from(_function: EaseInBounce) -> Self

Converts to this type from the input type.
source§

impl From<EaseInCircular> for EasingFunction

source§

fn from(_function: EaseInCircular) -> Self

Converts to this type from the input type.
source§

impl From<EaseInCubic> for EasingFunction

source§

fn from(_function: EaseInCubic) -> Self

Converts to this type from the input type.
source§

impl From<EaseInElastic> for EasingFunction

source§

fn from(_function: EaseInElastic) -> Self

Converts to this type from the input type.
source§

impl From<EaseInExponential> for EasingFunction

source§

fn from(_function: EaseInExponential) -> Self

Converts to this type from the input type.
source§

impl From<EaseInOutBack> for EasingFunction

source§

fn from(_function: EaseInOutBack) -> Self

Converts to this type from the input type.
source§

impl From<EaseInOutBounce> for EasingFunction

source§

fn from(_function: EaseInOutBounce) -> Self

Converts to this type from the input type.
source§

impl From<EaseInOutCircular> for EasingFunction

source§

fn from(_function: EaseInOutCircular) -> Self

Converts to this type from the input type.
source§

impl From<EaseInOutCubic> for EasingFunction

source§

fn from(_function: EaseInOutCubic) -> Self

Converts to this type from the input type.
source§

impl From<EaseInOutElastic> for EasingFunction

source§

fn from(_function: EaseInOutElastic) -> Self

Converts to this type from the input type.
source§

impl From<EaseInOutExponential> for EasingFunction

source§

fn from(_function: EaseInOutExponential) -> Self

Converts to this type from the input type.
source§

impl From<EaseInOutQuadradic> for EasingFunction

source§

fn from(_function: EaseInOutQuadradic) -> Self

Converts to this type from the input type.
source§

impl From<EaseInOutQuartic> for EasingFunction

source§

fn from(_function: EaseInOutQuartic) -> Self

Converts to this type from the input type.
source§

impl From<EaseInOutQuintic> for EasingFunction

source§

fn from(_function: EaseInOutQuintic) -> Self

Converts to this type from the input type.
source§

impl From<EaseInOutSine> for EasingFunction

source§

fn from(_function: EaseInOutSine) -> Self

Converts to this type from the input type.
source§

impl From<EaseInQuadradic> for EasingFunction

source§

fn from(_function: EaseInQuadradic) -> Self

Converts to this type from the input type.
source§

impl From<EaseInQuartic> for EasingFunction

source§

fn from(_function: EaseInQuartic) -> Self

Converts to this type from the input type.
source§

impl From<EaseInQuintic> for EasingFunction

source§

fn from(_function: EaseInQuintic) -> Self

Converts to this type from the input type.
source§

impl From<EaseInSine> for EasingFunction

source§

fn from(_function: EaseInSine) -> Self

Converts to this type from the input type.
source§

impl From<EaseOutBack> for EasingFunction

source§

fn from(_function: EaseOutBack) -> Self

Converts to this type from the input type.
source§

impl From<EaseOutBounce> for EasingFunction

source§

fn from(_function: EaseOutBounce) -> Self

Converts to this type from the input type.
source§

impl From<EaseOutCircular> for EasingFunction

source§

fn from(_function: EaseOutCircular) -> Self

Converts to this type from the input type.
source§

impl From<EaseOutCubic> for EasingFunction

source§

fn from(_function: EaseOutCubic) -> Self

Converts to this type from the input type.
source§

impl From<EaseOutElastic> for EasingFunction

source§

fn from(_function: EaseOutElastic) -> Self

Converts to this type from the input type.
source§

impl From<EaseOutExponential> for EasingFunction

source§

fn from(_function: EaseOutExponential) -> Self

Converts to this type from the input type.
source§

impl From<EaseOutQuadradic> for EasingFunction

source§

fn from(_function: EaseOutQuadradic) -> Self

Converts to this type from the input type.
source§

impl From<EaseOutQuartic> for EasingFunction

source§

fn from(_function: EaseOutQuartic) -> Self

Converts to this type from the input type.
source§

impl From<EaseOutQuintic> for EasingFunction

source§

fn from(_function: EaseOutQuintic) -> Self

Converts to this type from the input type.
source§

impl From<EaseOutSine> for EasingFunction

source§

fn from(_function: EaseOutSine) -> Self

Converts to this type from the input type.
source§

impl From<Linear> for EasingFunction

source§

fn from(_function: Linear) -> Self

Converts to this type from the input type.
source§

impl From<StandardEasing> for EasingFunction

source§

fn from(easing: StandardEasing) -> Self

Converts to this type from the input type.
source§

impl PartialEq for EasingFunction

source§

fn eq(&self, other: &EasingFunction) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<EasingFunction> for StandardEasing

§

type Error = NonStandardEasing

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

fn try_from(func: EasingFunction) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl StructuralPartialEq for EasingFunction

Auto Trait Implementations§

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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,

§

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>,

§

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>,

§

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.