Enum Easing Copy item path Source #[non_exhaustive]
pub enum Easing {
Hold,
Linear,
EaseIn,
EaseOut,
EaseInOut,
Bezier {
p1: (f64 , f64 ),
p2: (f64 , f64 ),
},
}Expand description Easing function applied to a keyframe interval.
Controls the shape of interpolation from one super::Keyframe to the
next. Each keyframe carries the easing used for the transition from that
keyframe to the subsequent one ; the last keyframe’s easing is unused.
Individual easing functions are implemented across issues #352–#357.
This enum is marked as non-exhaustive Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Hold: the value snaps to the next keyframe without interpolation.
Linear: constant-rate interpolation (y = t).
Cubic ease-in: slow start, fast end (y = t³).
Cubic ease-out: fast start, slow end (y = 1 − (1−t)³).
Cubic ease-in-out: slow at both ends, fast middle (y = 3t² − 2t³).
CSS-compatible cubic Bézier with two user-defined control points.
P0 = (0, 0) and P3 = (1, 1) are fixed; p1 and p2 define the curve
shape. Equivalent to the CSS cubic-bezier() function.
Fields First control point (x, y), x clamped to [0, 1].
Second control point (x, y), x clamped to [0, 1].
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Deserialize this value from the given Serde deserializer.
Read more Serialize this value into the given Serde serializer.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.