# Enum style::values::generics::easing::TimingFunction

``````#[repr(u8, C)]pub enum TimingFunction<Integer, Number, LinearStops> {
Keyword(TimingKeyword),
CubicBezier {
x1: Number,
y1: Number,
x2: Number,
y2: Number,
},
Steps(Integer, StepPosition),
LinearFunction(LinearStops),
}``````
Expand description

A generic easing function.

## Variants§

§

### Keyword(TimingKeyword)

`linear | ease | ease-in | ease-out | ease-in-out`

§

### CubicBezier

#### Fields

§`x1: Number`
§`y1: Number`
§`x2: Number`
§`y2: Number`

`cubic-bezier(<number>, <number>, <number>, <number>)`

§

### Steps(Integer, StepPosition)

`step-start | step-end | steps(<integer>, [ <step-position> ]?)` `<step-position> = jump-start | jump-end | jump-none | jump-both | start | end`

§

### LinearFunction(LinearStops)

linear([]#) = && ? = {1, 2}

## Implementations§

source§

### impl TimingFunction<i32, f32, PiecewiseLinearFunction>

source

source

#### pub fn calculate_output( &self, progress: f64, before_flag: BeforeFlag, epsilon: f64 ) -> f64

The output of the timing function given the progress ratio of this animation.

source§

### impl<Integer, Number, LinearStops> TimingFunction<Integer, Number, LinearStops>

source

`ease`

source

#### pub fn is_ease(&self) -> bool

Returns true if it is `ease`.

source§

### impl TimingFunction<Integer, Number, PiecewiseLinearFunction>

source

source

source

source

#### pub fn match_keywords(name: &AnimationName) -> bool

Returns true if the name matches any keyword.

source§

### impl TimingFunction<Integer, Number, PiecewiseLinearFunction>

source

#### pub fn to_computed_value_without_context(&self) -> ComputedTimingFunction

Generate the ComputedTimingFunction without Context.

## Trait Implementations§

source§

### impl<Integer: Clone, Number: Clone, LinearStops: Clone> Clone for TimingFunction<Integer, Number, LinearStops>

source§

#### fn clone(&self) -> TimingFunction<Integer, Number, LinearStops>

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<Integer: Debug, Number: Debug, LinearStops: Debug> Debug for TimingFunction<Integer, Number, LinearStops>

source§

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

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

### impl<'de, Integer, Number, LinearStops> Deserialize<'de> for TimingFunction<Integer, Number, LinearStops>where Integer: Deserialize<'de>, Number: Deserialize<'de>, LinearStops: Deserialize<'de>,

source§

#### fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

### impl<Integer, Number, LinearStops> MallocSizeOf for TimingFunction<Integer, Number, LinearStops>where Integer: MallocSizeOf, Number: MallocSizeOf, LinearStops: MallocSizeOf,

source§

#### fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
source§

### impl<Integer: PartialEq, Number: PartialEq, LinearStops: PartialEq> PartialEq<TimingFunction<Integer, Number, LinearStops>> for TimingFunction<Integer, Number, LinearStops>

source§

#### fn eq(&self, other: &TimingFunction<Integer, Number, LinearStops>) -> bool

This method tests for `self` and `other` values to be equal, and is used by `==`.
1.0.0 · source§

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

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

### impl<Integer, Number, LinearStops> Serialize for TimingFunction<Integer, Number, LinearStops>where Integer: Serialize, Number: Serialize, LinearStops: Serialize,

source§

#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

### impl<Integer, Number, LinearStops> SpecifiedValueInfo for TimingFunction<Integer, Number, LinearStops>where Integer: SpecifiedValueInfo, Number: SpecifiedValueInfo, LinearStops: SpecifiedValueInfo,

source§

#### const SUPPORTED_TYPES: u8 = 4u8

Supported CssTypes by the given value type. Read more
source§

#### fn collect_completion_keywords(_f: &mut dyn FnMut(&[&'static str]))

Collect value starting words for the given specified value type. This includes keyword and function names which can appear at the beginning of a value of this type. Read more
source§

### impl<Integer, Number, LinearStops> ToCss for TimingFunction<Integer, Number, LinearStops>where Integer: ToCss, Number: ToCss, LinearStops: ToCss,

source§

#### fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere W: Write,

Serialize `self` in CSS syntax, writing to `dest`.
source§

#### fn to_css_string(&self) -> String

Serialize `self` in CSS syntax and return a string. Read more
source§

### impl<Integer, Number, LinearStops> ToShmem for TimingFunction<Integer, Number, LinearStops>where Integer: ToShmem, Number: ToShmem, LinearStops: ToShmem,

source§

#### fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

Clones this value into a form suitable for writing into a SharedMemoryBuilder. Read more
source§

§

§

§

§

§

## Blanket Implementations§

source§

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

source§

#### fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more
source§

### impl<T> Borrow<T> for Twhere T: ?Sized,

source§

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

### impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

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

Mutably borrows from an owned value. 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 Twhere 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> IntoEither for T

source§

#### 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 more
source§

#### fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,

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 more
source§

source§

Convert
source§

source§

Convert
source§

### impl<T> Pointable for T

source§

#### const ALIGN: usize = _

The alignment of pointer.
§

#### type Init = T

The type for initializers.
source§

#### unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

#### unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

#### unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

#### unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

### impl<T> Same<T> for T

§

#### type Output = T

Should always be `Self`
source§

### impl<T> ToOwned for Twhere 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 Twhere 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 Twhere 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.
source§

source§

source§

source§