Trait style::values::animated::ToAnimatedValue
source · 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.
Object Safety§
This trait is not object safe.