pub trait Animated<T, X: Time> {
// Required methods
fn get(&self, time: X) -> T;
fn is_finished(&self, time: X) -> bool;
// Provided methods
fn map<R, F: Fn(T) -> R>(self, map: F) -> AnimatedMap<T, X, Self, R, F>
where Self: Sized { ... }
fn join<T2, A2: Animated<T2, X>>(
self,
other: A2,
) -> AnimatedJoin<T, T2, X, Self, A2>
where Self: Sized { ... }
fn flatten<R>(self) -> AnimatedFlatten<R, X, T, Self>
where Self: Sized,
T: Animated<R, X> { ... }
}Expand description
An animated value that changes over time.
It’s a common trait for Animation and Inertial.
Required Methods§
Sourcefn get(&self, time: X) -> T
fn get(&self, time: X) -> T
Get the value of the animation at a specific time.
time- The time to get the value of the animation, usuallyInstant::now().
Sourcefn is_finished(&self, time: X) -> bool
fn is_finished(&self, time: X) -> bool
Check if the animation is finished at a specific time.
Provided Methods§
Sourcefn map<R, F: Fn(T) -> R>(self, map: F) -> AnimatedMap<T, X, Self, R, F>where
Self: Sized,
fn map<R, F: Fn(T) -> R>(self, map: F) -> AnimatedMap<T, X, Self, R, F>where
Self: Sized,
Map the animated value to another type.