Trait cushy::animation::Animate

source ·
pub trait Animate: Send + Sync {
    // Required method
    fn animate(&mut self, elapsed: Duration) -> ControlFlow<Duration>;
}
Expand description

A type that can animate.

Required Methods§

source

fn animate(&mut self, elapsed: Duration) -> ControlFlow<Duration>

Update the animation by progressing the timeline by elapsed.

When the animation is complete, return ControlFlow::Break with the remaining time that was not needed to complete the animation. This is used in multi-step animation processes to ensure time is accurately tracked.

Trait Implementations§

source§

impl Spawn for Box<dyn Animate>

source§

fn spawn(self) -> AnimationHandle

Spawns the animation, returning a handle that tracks the animation. Read more
source§

fn launch(self)
where Self: Sized,

Launches this animation, running it to completion in the background.

Implementations on Foreign Types§

source§

impl Animate for Duration

source§

fn animate(&mut self, elapsed: Duration) -> ControlFlow<Duration>

source§

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

source§

fn animate(&mut self, elapsed: Duration) -> ControlFlow<Duration>

source§

impl<T0, T1> Animate for (T0, T1)
where T0: Animate, T1: Animate,

source§

fn animate(&mut self, elapsed: Duration) -> ControlFlow<Duration>

source§

impl<T0, T1, T2> Animate for (T0, T1, T2)
where T0: Animate, T1: Animate, T2: Animate,

source§

fn animate(&mut self, elapsed: Duration) -> ControlFlow<Duration>

source§

impl<T0, T1, T2, T3> Animate for (T0, T1, T2, T3)
where T0: Animate, T1: Animate, T2: Animate, T3: Animate,

source§

fn animate(&mut self, elapsed: Duration) -> ControlFlow<Duration>

source§

impl<T0, T1, T2, T3, T4> Animate for (T0, T1, T2, T3, T4)
where T0: Animate, T1: Animate, T2: Animate, T3: Animate, T4: Animate,

source§

fn animate(&mut self, elapsed: Duration) -> ControlFlow<Duration>

source§

impl<T0, T1, T2, T3, T4, T5> Animate for (T0, T1, T2, T3, T4, T5)
where T0: Animate, T1: Animate, T2: Animate, T3: Animate, T4: Animate, T5: Animate,

source§

fn animate(&mut self, elapsed: Duration) -> ControlFlow<Duration>

Implementors§

source§

impl Animate for SharedCallback

source§

impl Animate for SharedCallback<Duration, ControlFlow<Duration>>

source§

impl<A> Animate for Cycle<A>
where A: IntoAnimate + Clone,

source§

impl<A> Animate for OnCompleteAnimation<A>
where A: Animate,

source§

impl<A, B> Animate for RunningChain<A, B>
where A: IntoAnimate, B: IntoAnimate,

source§

impl<F> Animate for F
where F: FnMut(Duration) -> ControlFlow<Duration> + Send + Sync + 'static,

source§

impl<T, Easing> Animate for RunningAnimation<T, Easing>
where T: AnimateTarget, Easing: Easing,