pub trait Animate: Sized {
// Required method
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>;
}
Expand description
Animate from one value to another.
This trait is derivable with #[derive(Animate)]
. The derived
implementation uses a match
expression with identical patterns for both
self
and other
, calling Animate::animate
on each fields of the values.
If a field is annotated with #[animation(constant)]
, the two values should
be equal or an error is returned.
If a variant is annotated with #[animation(error)]
, the corresponding
match
arm returns an error.
Trait bounds for type parameter Foo
can be opted out of with
#[animation(no_bound(Foo))]
on the type definition, trait bounds for
fields can be opted into with #[animation(field_bound)]
on the field.
Required Methods§
Object Safety§
Implementations on Foreign Types§
Implementors§
impl Animate for AnimationValue
impl Animate for T
impl Animate for AngleOrPercentage
impl Animate for NumberOrPercentage
impl Animate for ArcSize
impl Animate for ArcSweep
impl Animate for ByTo
impl Animate for FillRule
impl Animate for ShapeBox
impl Animate for ShapeGeometryBox
impl Animate for VerticalAlignKeyword
impl Animate for RaySize
impl Animate for FontSizeKeyword
impl Animate for CoordBox
impl Animate for DProperty
impl Animate for TransformBox
impl Animate for AbsoluteColor
impl Animate for style::properties::generated::longhands::background_position_x::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl Animate for style::properties::generated::longhands::background_position_y::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl Animate for style::properties::generated::longhands::background_size::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl Animate for style::properties::generated::longhands::box_shadow::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl Animate for style::properties::generated::longhands::filter::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl Animate for style::properties::generated::longhands::text_shadow::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl Animate for CustomAnimatedValue
impl Animate for Angle
impl Animate for FontSize
impl Animate for CSSPixelLength
impl Animate for LengthPercentage
https://drafts.csswg.org/css-transitions/#animtype-lpcalc https://drafts.csswg.org/css-values-4/#combine-math https://drafts.csswg.org/css-values-4/#combine-mixed
impl Animate for OffsetRotate
impl Animate for Percentage
impl Animate for Resolution
impl Animate for Time
impl Animate for Path
impl Animate for TrackRepeat<LengthPercentage, Integer>
impl Animate for Ratio<f32>
https://drafts.csswg.org/css-values/#combine-ratio
impl Animate for KeywordInfo
impl Animate for SVGPathData
impl Animate for InnerMatrix2D
impl Animate for MatrixDecomposed2D
impl Animate for MatrixDecomposed3D
impl Animate for Perspective
impl Animate for Quaternion
impl Animate for Scale2D
impl Animate for Scale3D
impl Animate for Skew
impl Animate for Translate2D
impl Animate for Translate3D
impl Animate for PathOrShapeFunction
impl Animate for LineClamp
impl Animate for FontVariationSettings
https://drafts.csswg.org/css-fonts-4/#font-variation-settings-def
Note that the ComputedValue implementation will already have sorted and de-dup’d the lists of settings, so we can just iterate over the two lists together and animate their individual values.