Keyframe

Struct Keyframe 

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

Source

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 from 0.0 (0%) to 1.0 (100%).
  • data - Data for this keyframe, normally a struct with Option fields generated by the Animate macro.
  • easing - Easing function to use for this keyframe, and subsequent keyframes that do not provide their own easing. Specifying None will 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§

Source§

impl<Data> Clone for Keyframe<Data>
where Data: Clone,

Source§

fn clone(&self) -> Keyframe<Data>

Returns a duplicate 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<Data> Debug for Keyframe<Data>
where Data: Debug + Clone,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Data> Freeze for Keyframe<Data>
where Data: Freeze,

§

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> 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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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,

Source§

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

Source§

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

Source§

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.