Animation

Struct Animation 

Source
pub struct Animation<I, X: Time, T: Keyframes<I, X>> { /* private fields */ }
Expand description

Running keyframes animation started at a specific time.

Implementations§

Source§

impl<I, X: Time, T: Keyframes<I, X>> Animation<I, X, T>

Source

pub fn start(keyframes: T, start_time: X) -> Self

Start the animation at a specific time.

  • keyframes - The transition to animate.
  • start_time - The time to start the animation, usually Instant::now().
Source

pub fn start_time(&self) -> X

Get the start time of the animation.

Source

pub fn end_time(&self) -> X

Get the end time of the animation. Infinite animations will panic.

Source

pub fn duration(&self) -> X::Duration

Get the duration of the animation. Infinite animations will panic.

Source

pub fn is_finite(&self) -> bool

Check if the animation is infinite.

Trait Implementations§

Source§

impl<I, X: Time, T: Keyframes<I, X>> Animated<I, X> for Animation<I, X, T>

Source§

fn get(&self, time: X) -> I

Get the value of the animation at a specific time. Read more
Source§

fn is_finished(&self, time: X) -> bool

Check if the animation is finished at a specific time.
Source§

fn map<R, F: Fn(T) -> R>(self, map: F) -> AnimatedMap<T, X, Self, R, F>
where Self: Sized,

Map the animated value to another type.
Source§

fn join<T2, A2: Animated<T2, X>>( self, other: A2, ) -> AnimatedJoin<T, T2, X, Self, A2>
where Self: Sized,

Join two animated values into a single animated tuple. The resulting animation will be finished when both animations are finished.
Source§

fn flatten<R>(self) -> AnimatedFlatten<R, X, T, Self>
where Self: Sized, T: Animated<R, X>,

Flatten an animated value of an animated value into a single animated value. The resulting animation will be finished when both animations are finished.
Source§

impl<I, X: Time, T: Keyframes<I, X> + Clone> Clone for Animation<I, X, T>

Source§

fn clone(&self) -> Self

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<I, X, T: Keyframes<I, X> + Debug> Debug for Animation<I, X, T>
where X: Debug + Time,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<I, X: Time, T: Keyframes<I, X> + PartialEq> PartialEq for Animation<I, X, T>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, X: Time, T: Keyframes<I, X> + Copy> Copy for Animation<I, X, T>

Auto Trait Implementations§

§

impl<I, X, T> Freeze for Animation<I, X, T>
where T: Freeze, X: Freeze,

§

impl<I, X, T> RefUnwindSafe for Animation<I, X, T>

§

impl<I, X, T> Send for Animation<I, X, T>
where T: Send, X: Send, I: Send,

§

impl<I, X, T> Sync for Animation<I, X, T>
where T: Sync, X: Sync, I: Sync,

§

impl<I, X, T> Unpin for Animation<I, X, T>
where T: Unpin, X: Unpin, I: Unpin,

§

impl<I, X, T> UnwindSafe for Animation<I, X, T>
where T: UnwindSafe, X: UnwindSafe, I: UnwindSafe,

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