Trait style::values::animated::Animate

source ·
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§

source

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

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

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 Animate for i32

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 T

source§

impl Animate for AngleOrPercentage

source§

impl Animate for NumberOrPercentage

source§

impl Animate for ArcSize

source§

impl Animate for ArcSweep

source§

impl Animate for ByTo

source§

impl Animate for FillRule

source§

impl Animate for ShapeBox

source§

impl Animate for ShapeGeometryBox

source§

impl Animate for VerticalAlignKeyword

source§

impl Animate for RaySize

source§

impl Animate for FontSizeKeyword

source§

impl Animate for CoordBox

source§

impl Animate for DProperty

source§

impl Animate for TransformBox

source§

impl Animate for AbsoluteColor

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl Animate for CustomAnimatedValue

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 Resolution

source§

impl Animate for Time

source§

impl Animate for Path

source§

impl Animate for TrackRepeat<LengthPercentage, Integer>

source§

impl Animate for Ratio<f32>

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

source§

impl Animate for KeywordInfo

source§

impl Animate for SVGPathData

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 PathOrShapeFunction

source§

impl Animate for LineClamp

source§

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.

source§

impl Animate for Matrix3D

source§

impl Animate for Matrix

source§

impl Animate for Rotate

source§

impl Animate for Scale

source§

impl Animate for Transform

source§

impl Animate for TransformOperation

source§

impl Animate for Translate

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, LengthPercentage> Animate for GenericShapeCommand<Angle, LengthPercentage>
where Angle: Animate, LengthPercentage: Animate,

source§

impl<Angle, LengthPercentage> Animate for Shape<Angle, LengthPercentage>
where Angle: Animate, LengthPercentage: Animate,

source§

impl<Angle, Position> Animate for GenericRayFunction<Angle, Position>
where Angle: Animate, Position: Animate,

source§

impl<Angle, Position, LengthPercentage, NonNegativeLengthPercentage, BasicShapeRect> Animate for GenericBasicShape<Angle, Position, LengthPercentage, NonNegativeLengthPercentage, BasicShapeRect>
where Angle: Animate, Position: Animate, LengthPercentage: Animate, NonNegativeLengthPercentage: Animate, BasicShapeRect: Animate, GenericPathOrShapeFunction<Angle, LengthPercentage>: 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<Component> Animate for ValueInner<Component>
where Component: Animate, ComponentList<Component>: Animate,

source§

impl<Component: Animate> Animate for ComponentList<Component>

source§

impl<Component: Animate> Animate for Value<Component>

source§

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

source§

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

source§

impl<H, V> Animate for GenericOffsetPosition<H, V>
where H: Animate, V: 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<I> Animate for GenericZIndex<I>
where I: Animate,

source§

impl<L> Animate for GenericContainIntrinsicSize<L>
where L: 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 GenericLetterSpacing<L>
where L: Animate,

source§

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

source§

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

source§

impl<L> Animate for GenericBorderSpacing<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<Length, Number, Percentage, LengthPercentage, Color, Image, Url, Integer, Angle, Time, Resolution, TransformFunction> Animate for GenericValueComponent<Length, Number, Percentage, LengthPercentage, Color, Image, Url, Integer, Angle, Time, Resolution, TransformFunction>
where Length: Animate, Number: Animate, Percentage: Animate, LengthPercentage: Animate, Color: Animate, Integer: Animate, Angle: Animate, Time: Animate, Resolution: Animate, TransformFunction: 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 CoordinatePair<LengthPercentage>
where LengthPercentage: Animate,

source§

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

source§

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

source§

impl<LengthPercentage> Animate for GenericTextIndent<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 GenericInsetRect<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>

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 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<Position, NonNegativeLengthPercentage> Animate for Circle<Position, NonNegativeLengthPercentage>
where Position: Animate, NonNegativeLengthPercentage: Animate,

source§

impl<Position, NonNegativeLengthPercentage> Animate for Ellipse<Position, NonNegativeLengthPercentage>
where Position: Animate, NonNegativeLengthPercentage: Animate,

source§

impl<PositiveInteger> Animate for GenericColumnCount<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<Shapes, RayFunction, U> Animate for GenericOffsetPathFunction<Shapes, RayFunction, U>
where Shapes: Animate, RayFunction: 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,