Struct mina::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 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<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> !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 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> DynClone for Twhere 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 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> 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.