pub struct Keyframe<Data>where
Data: Clone,{ /* private fields */ }Expand description
A single frame of an animation timeline, specifying some or all of the animation property values at a given point in time.
Keyframes are normally an intermediate type used by the Animate macro
when constructing Timeline instances. They are not meant to be created or consumed directly.
Instead, the Animate decorated type will expose trait functions for creating keyframes as part
of the timeline builder.
Implementations§
source§impl<Data> Keyframe<Data>where
Data: Clone,
impl<Data> Keyframe<Data>where Data: Clone,
sourcepub fn new(
normalized_time: f32,
data: Data,
easing: Option<Easing>
) -> Keyframe<Data>
pub fn new( normalized_time: f32, data: Data, easing: Option<Easing> ) -> Keyframe<Data>
Creates a new keyframe.
This function is intended for use by KeyframeBuilder implementations and should normally
not be needed by user code.
Arguments
normalized_time- Position of the keyframe on a normalized time scale from0.0(0%) to1.0(100%).data- Data for this keyframe, normally a struct withOptionfields generated by theAnimatemacro.easing- Easing function to use for this keyframe, and subsequent keyframes that do not provide their owneasing. SpecifyingNonewill cause the keyframe to use the easing of the previous keyframe, or if there are no previous keyframes, then the default easing for the timeline containing the keyframe.
Trait Implementations§
Auto Trait Implementations§
impl<Data> !RefUnwindSafe for Keyframe<Data>
impl<Data> Send for Keyframe<Data>where Data: Send,
impl<Data> Sync for Keyframe<Data>where Data: Sync,
impl<Data> Unpin for Keyframe<Data>where Data: Unpin,
impl<Data> !UnwindSafe for Keyframe<Data>
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