Skip to main content

Animating

Trait Animating 

Source
pub trait Animating:
    Send
    + Sync
    + 'static {
    // Required method
    fn progress(&self, time: f64) -> Option<f64>;
}
Expand description

A timing curve written in Rust.

Required Methods§

Source

fn progress(&self, time: f64) -> Option<f64>

How much of the value to apply at time seconds in, or None when the animation is over.

0.0 is the starting value and 1.0 the target, but nothing stops a curve from overshooting — that is what a spring does.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> Animating for F
where F: Fn(f64) -> Option<f64> + Send + Sync + 'static,