pub struct Keyframe<T: Lerp> {
pub timestamp: Duration,
pub value: T,
pub easing: Easing,
}Expand description
A single keyframe in an animation track.
The easing field controls the interpolation from this keyframe to the
next one. The last keyframe’s easing is never used (there is no
subsequent keyframe to interpolate toward).
§Ordering
Keyframes are ordered and compared by timestamp only. Two keyframes at
the same timestamp are considered equal regardless of their values or easing
— this keeps binary-search by timestamp correct inside
AnimationTrack (added in issue #350).
Fields§
§timestamp: DurationPosition of this keyframe on the timeline.
value: TValue held at (and interpolated from) this keyframe.
easing: EasingEasing applied for the transition from this keyframe to the next.
Implementations§
Trait Implementations§
Source§impl<T: Lerp> Ord for Keyframe<T>
impl<T: Lerp> Ord for Keyframe<T>
Source§impl<T: Lerp> PartialOrd for Keyframe<T>
impl<T: Lerp> PartialOrd for Keyframe<T>
impl<T: Lerp> Eq for Keyframe<T>
Auto Trait Implementations§
impl<T> Freeze for Keyframe<T>where
T: Freeze,
impl<T> RefUnwindSafe for Keyframe<T>where
T: RefUnwindSafe,
impl<T> Send for Keyframe<T>where
T: Send,
impl<T> Sync for Keyframe<T>where
T: Sync,
impl<T> Unpin for Keyframe<T>where
T: Unpin,
impl<T> UnsafeUnpin for Keyframe<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Keyframe<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more