pub trait Animatable: Clone {
type AnimatableData: Interpolatable;
// Required methods
fn animatable_data(&self) -> Self::AnimatableData;
fn from_animatable_data(data: Self::AnimatableData) -> Self;
}Expand description
SwiftUI-style animation protocol.
Types expose an animatable representation (AnimatableData) that can be
linearly interpolated by the animation system.
Required Associated Types§
Sourcetype AnimatableData: Interpolatable
type AnimatableData: Interpolatable
Interpolatable payload used for frame-to-frame value blending.
Required Methods§
Sourcefn animatable_data(&self) -> Self::AnimatableData
fn animatable_data(&self) -> Self::AnimatableData
Exports the value to its animatable representation.
Sourcefn from_animatable_data(data: Self::AnimatableData) -> Self
fn from_animatable_data(data: Self::AnimatableData) -> Self
Reconstructs the value from animatable data.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".