pub trait ToAnimatedValue {
type AnimatedValue;
// Required methods
fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue;
fn from_animated_value(animated: Self::AnimatedValue) -> Self;
}
Expand description
Conversion between computed values and intermediate values for animations.
Notably, colors are represented as four floats during animations.
This trait is derivable with #[derive(ToAnimatedValue)]
.
Required Associated Types§
Sourcetype AnimatedValue
type AnimatedValue
The type of the animated value.
Required Methods§
Sourcefn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
Converts this value to an animated value.
Sourcefn from_animated_value(animated: Self::AnimatedValue) -> Self
fn from_animated_value(animated: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.
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.