Skip to main content

Animatable

Trait Animatable 

Source
pub trait Animatable:
    Interpolate
    + Clone
    + 'static { }
Expand description

Marker trait for types that can be used as animation targets.

Any type implementing Interpolate + Clone + 'static automatically satisfies Animatable through a blanket impl. You never implement this trait manually.

§Example

use animato_core::Animatable;

fn animate<T: Animatable>(start: T, end: T) {
    let mid = start.lerp(&end, 0.5);
    let _ = mid;
}

animate(0.0_f32, 1.0_f32);
animate([0.0_f32; 3], [1.0_f32; 3]);

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.

Implementors§

Source§

impl<T: Interpolate + Clone + 'static> Animatable for T

Blanket impl — every Interpolate + Clone + 'static is automatically Animatable.