pub trait Animate: Sized {
    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§

source

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

Animate a value towards another one, given an animation procedure.

Implementations on Foreign Types§

source§

impl Animate for i32

source§

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

source§

impl Animate for f32

source§

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

source§

impl Animate for f64

source§

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

source§

impl<T> Animate for Option<T>where
    T: Animate,

source§

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

source§

impl<T: Animate> Animate for Box<T>

source§

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

Implementors§

source§

impl Animate for AnimationValue

source§

impl Animate for Visibility

source§

impl Animate for AngleOrPercentage

source§

impl Animate for NumberOrPercentage

source§

impl Animate for ShapeBox

source§

impl Animate for ShapeGeometryBox

source§

impl Animate for VerticalAlignKeyword

source§

impl Animate for FontSizeKeyword

source§

impl Animate for DProperty

source§

impl Animate for IsAbsolute

source§

impl Animate for PathCommand

source§

impl Animate for style::properties::longhands::background_position_x::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>

source§

impl Animate for style::properties::longhands::background_position_y::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>

source§

impl Animate for style::properties::longhands::background_size::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>

source§

impl Animate for style::properties::longhands::box_shadow::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>

source§

impl Animate for style::properties::longhands::filter::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>

source§

impl Animate for style::properties::longhands::text_shadow::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>

source§

impl Animate for Angle

source§

impl Animate for FontSize

source§

impl Animate for CSSPixelLength

source§

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

source§

impl Animate for OffsetRotate

source§

impl Animate for Percentage

source§

impl Animate for Au

source§

impl Animate for LetterSpacing

source§

impl Animate for Path

source§

impl Animate for TrackRepeat<LengthPercentage, Integer>

source§

impl Animate for KeywordInfo

source§

impl Animate for ArcFlag

source§

impl Animate for CoordPair

source§

impl Animate for SVGPathData

source§

impl Animate for Auto

source§

impl Animate for None_

source§

impl Animate for RGBA

source§

impl Animate for InnerMatrix2D

source§

impl Animate for MatrixDecomposed2D

source§

impl Animate for MatrixDecomposed3D

source§

impl Animate for Perspective

source§

impl Animate for Quaternion

source§

impl Animate for Scale2D

source§

impl Animate for Scale3D

source§

impl Animate for Skew

source§

impl Animate for Translate2D

source§

impl Animate for Translate3D

source§

impl Animate for FontVariationSettings

source§

impl Animate for Ratio

https://drafts.csswg.org/css-values/#combine-ratio

source§

impl Animate for Matrix3D

source§

impl Animate for Matrix

source§

impl Animate for ComputedRotate

source§

impl Animate for ComputedScale

source§

impl Animate for ComputedTransform

source§

impl Animate for ComputedTransformOperation

source§

impl Animate for ComputedTranslate

source§

impl Animate for ClipRect

source§

impl Animate for TrackList

source§

impl Animate for TrackSize

source§

impl Animate for Color

source§

impl Animate for AnimatedFilter

source§

impl<A, B> Animate for Either<A, B>where
    A: Animate,
    B: Animate,

source§

impl<Angle> Animate for FontStyle<Angle>where
    Angle: Animate,

source§

impl<Angle> Animate for GenericOffsetPath<Angle>where
    Angle: Animate,

source§

impl<Angle> Animate for RayFunction<Angle>where
    Angle: Animate,

source§

impl<BasicShape, I> Animate for GenericShapeOutside<BasicShape, I>where
    BasicShape: Animate,

source§

impl<BasicShape, U> Animate for GenericClipPath<BasicShape, U>where
    BasicShape: Animate,

source§

impl<C> Animate for GenericColorOrAuto<C>where
    C: Animate,

source§

impl<C> Animate for GenericSVGPaintFallback<C>where
    C: Animate,

source§

impl<C> Animate for GenericCaretColor<C>where
    C: Animate,

source§

impl<C, U> Animate for GenericSVGPaintKind<C, U>where
    C: Animate,

source§

impl<Color> Animate for GenericScrollbarColor<Color>where
    Color: Animate,

source§

impl<Color, SizeLength, BlurShapeLength, ShapeLength> Animate for GenericBoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength>where
    Color: Animate,
    SizeLength: Animate,
    BlurShapeLength: Animate,
    ShapeLength: Animate,

source§

impl<Color, SizeLength, ShapeLength> Animate for GenericSimpleShadow<Color, SizeLength, ShapeLength>where
    Color: Animate,
    SizeLength: Animate,
    ShapeLength: Animate,

source§

impl<Color, Url> Animate for GenericSVGPaint<Color, Url>where
    Color: Animate,

source§

impl<H, V> Animate for GenericPosition<H, V>where
    H: Animate,
    V: Animate,

source§

impl<H, V, Depth> Animate for GenericTransformOrigin<H, V, Depth>where
    H: Animate,
    V: Animate,
    Depth: Animate,

source§

impl<H, V, LengthPercentage, NonNegativeLengthPercentage> Animate for GenericBasicShape<H, V, LengthPercentage, NonNegativeLengthPercentage>where
    H: Animate,
    V: Animate,
    LengthPercentage: Animate,
    NonNegativeLengthPercentage: Animate,

source§

impl<H, V, NonNegativeLengthPercentage> Animate for Circle<H, V, NonNegativeLengthPercentage>where
    H: Animate,
    V: Animate,
    NonNegativeLengthPercentage: Animate,

source§

impl<H, V, NonNegativeLengthPercentage> Animate for Ellipse<H, V, NonNegativeLengthPercentage>where
    H: Animate,
    V: Animate,
    NonNegativeLengthPercentage: Animate,

source§

impl<I> Animate for GenericZIndex<I>where
    I: Animate,

source§

impl<L> Animate for GenericTrackBreadth<L>where
    L: Animate,

source§

impl<L> Animate for GenericSVGLength<L>where
    L: Animate,

source§

impl<L> Animate for SVGStrokeDashArray<L>where
    L: Clone + Animate,

source§

impl<L> Animate for GenericTextDecorationLength<L>where
    L: Animate,

source§

impl<L> Animate for Polygon<L>where
    L: Animate,

source§

impl<L> Animate for BorderSpacing<L>where
    L: Animate,

source§

impl<L> Animate for GenericBorderCornerRadius<L>where
    L: Animate,

source§

impl<L> Animate for Size2D<L>where
    L: Animate,

source§

impl<L, I> Animate for GenericGridTemplateComponent<L, I>where
    L: Animate,
    I: Animate,
    Box<GenericTrackList<L, I>>: Animate,

source§

impl<L, N> Animate for GenericLengthOrNumber<L, N>where
    L: Animate,
    N: Animate,

source§

impl<LP, N> Animate for GenericBorderImageSideWidth<LP, N>where
    LP: Animate,
    N: Animate,

source§

impl<LengthPercent> Animate for GenericBackgroundSize<LengthPercent>where
    LengthPercent: Animate,

source§

impl<LengthPercent> Animate for GenericLengthPercentageOrAuto<LengthPercent>where
    LengthPercent: Animate,

source§

impl<LengthPercent> Animate for GenericLengthPercentageOrNormal<LengthPercent>where
    LengthPercent: Animate,

source§

impl<LengthPercent> Animate for GenericMaxSize<LengthPercent>where
    LengthPercent: Animate,

source§

impl<LengthPercent> Animate for GenericSize<LengthPercent>where
    LengthPercent: Animate,

source§

impl<LengthPercentage> Animate for GenericVerticalAlign<LengthPercentage>where
    LengthPercentage: Animate,

source§

impl<LengthPercentage> Animate for GenericBorderRadius<LengthPercentage>where
    LengthPercentage: Animate,

source§

impl<LengthPercentage, Integer> Animate for GenericTrackListValue<LengthPercentage, Integer>where
    LengthPercentage: Animate,
    Integer: Animate,
    GenericTrackSize<LengthPercentage>: Animate,
    GenericTrackRepeat<LengthPercentage, Integer>: Animate,

source§

impl<LengthPercentage, NonNegativeLengthPercentage> Animate for InsetRect<LengthPercentage, NonNegativeLengthPercentage>where
    LengthPercentage: Animate,
    NonNegativeLengthPercentage: Animate,

source§

impl<N> Animate for PreferredRatio<N>where
    N: Animate,
    Ratio<N>: Animate,

source§

impl<N> Animate for GenericAspectRatio<N>where
    N: Animate,
    PreferredRatio<N>: Animate,

source§

impl<N, L> Animate for GenericLineHeight<N, L>where
    N: Animate,
    L: Animate,

source§

impl<NonNegativeLength> Animate for GenericPerspective<NonNegativeLength>where
    NonNegativeLength: Animate,

source§

impl<NonNegativeLengthPercentage> Animate for GenericShapeRadius<NonNegativeLengthPercentage>where
    NonNegativeLengthPercentage: Animate,

source§

impl<Number> Animate for GenericFontSizeAdjust<Number>where
    Number: Animate,

source§

impl<Number> Animate for VariationValue<Number>where
    Number: Animate,

source§

impl<NumberOrPercentage> Animate for GenericBorderImageSlice<NumberOrPercentage>where
    NumberOrPercentage: Animate,

source§

impl<OpacityType> Animate for GenericSVGOpacity<OpacityType>where
    OpacityType: Animate,

source§

impl<Pos> Animate for GenericPositionOrAuto<Pos>where
    Pos: Animate,

source§

impl<PositiveInteger> Animate for ColumnCount<PositiveInteger>where
    PositiveInteger: Animate,

source§

impl<R> Animate for GenericClipRectOrAuto<R>where
    R: Animate,

source§

impl<S> Animate for GenericFlexBasis<S>where
    S: Animate,

source§

impl<T> Animate for Optional<T>where
    T: Animate,

source§

impl<T> Animate for Rect<T>where
    T: Animate,

source§

impl<T> Animate for GreaterThanOrEqualToOne<T>where
    T: Animate,

source§

impl<T> Animate for NonNegative<T>where
    T: Animate,

source§

impl<T> Animate for ZeroToOne<T>where
    T: Animate,

source§

impl<U> Animate for GenericUrlOrNone<U>where
    U: Animate,