cushy::animation

Trait AnimationTarget

Source
pub trait AnimationTarget:
    Sized
    + Send
    + Sync {
    type Running: AnimateTarget;

    // Required method
    fn begin(self) -> Self::Running;

    // Provided methods
    fn over(self, duration: Duration) -> Animation<Self, Linear> { ... }
    fn immediately(self) -> Animation<Self, Linear> { ... }
}
Expand description

A target for a timed Animation.

Required Associated Types§

Source

type Running: AnimateTarget

The type that can linearly interpolate this target.

Required Methods§

Source

fn begin(self) -> Self::Running

Record the current value of the target, and return a type that can linearly interpolate between the current value and the desired value.

Provided Methods§

Source

fn over(self, duration: Duration) -> Animation<Self, Linear>

Returns a pending animation that linearly transitions self over duration.

A different Easing can be used by calling with_easing on the result of this function.

Source

fn immediately(self) -> Animation<Self, Linear>

Returns a pending animation that transitions to the target values after no delay.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T0> AnimationTarget for (T0,)
where T0: AnimationTarget,

Source§

type Running = (<T0 as AnimationTarget>::Running,)

Source§

fn begin(self) -> Self::Running

Source§

impl<T0, T1> AnimationTarget for (T0, T1)

Source§

impl<T0, T1, T2> AnimationTarget for (T0, T1, T2)

Source§

impl<T0, T1, T2, T3> AnimationTarget for (T0, T1, T2, T3)

Source§

impl<T0, T1, T2, T3, T4> AnimationTarget for (T0, T1, T2, T3, T4)

Source§

impl<T0, T1, T2, T3, T4, T5> AnimationTarget for (T0, T1, T2, T3, T4, T5)

Implementors§