cushy::animation

Trait IntoAnimate

Source
pub trait IntoAnimate:
    Sized
    + Send
    + Sync {
    type Animate: Animate;

    // Required method
    fn into_animate(self) -> Self::Animate;

    // Provided methods
    fn to_animate(&self) -> Self::Animate
       where Self: Clone { ... }
    fn and_then<Other: IntoAnimate>(self, other: Other) -> Chain<Self, Other> { ... }
    fn cycle(self) -> Cycle<Self>
       where Self: Clone { ... }
    fn repeat(self, times: usize) -> Cycle<Self>
       where Self: Clone { ... }
    fn on_complete<F>(self, on_complete: F) -> OnCompleteAnimation<Self>
       where F: FnOnce() + Send + Sync + 'static { ... }
}
Expand description

A type that can be converted into an animation.

Required Associated Types§

Source

type Animate: Animate

The running animation type.

Required Methods§

Source

fn into_animate(self) -> Self::Animate

Return this change as a running animation.

Provided Methods§

Source

fn to_animate(&self) -> Self::Animate
where Self: Clone,

Returns a clone of this change as a running animation.

Source

fn and_then<Other: IntoAnimate>(self, other: Other) -> Chain<Self, Other>

Returns an combined animation that performs self and other in sequence.

Source

fn cycle(self) -> Cycle<Self>
where Self: Clone,

Returns an animation that repeats self indefinitely.

Source

fn repeat(self, times: usize) -> Cycle<Self>
where Self: Clone,

Returns an animation that repeats a number of times before completing.

Source

fn on_complete<F>(self, on_complete: F) -> OnCompleteAnimation<Self>
where F: FnOnce() + Send + Sync + 'static,

Invokes on_complete after this animation finishes.

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 IntoAnimate for Duration

Source§

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

Source§

type Animate = (<T0 as IntoAnimate>::Animate,)

Source§

fn into_animate(self) -> Self::Animate

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§