Trait cushy::animation::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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

§

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

source§

fn begin(self) -> Self::Running

source§

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

§

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

source§

fn begin(self) -> Self::Running

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§