pub trait ToAnimatedValue {
    type AnimatedValue;

    // Required methods
    fn to_animated_value(self) -> 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§

source

type AnimatedValue

The type of the animated value.

Required Methods§

source

fn to_animated_value(self) -> Self::AnimatedValue

Converts this value to an animated value.

source

fn from_animated_value(animated: Self::AnimatedValue) -> Self

Converts back an animated value into a computed value.

Implementations on Foreign Types§

source§

impl<T> ToAnimatedValue for Vec<T>where T: ToAnimatedValue,

source§

impl ToAnimatedValue for i32

source§

impl ToAnimatedValue for bool

source§

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

source§

impl ToAnimatedValue for f32

source§

impl<T> ToAnimatedValue for Box<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for SmallVec<[T; 1]>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for Box<[T]>where T: ToAnimatedValue,

Implementors§

source§

impl ToAnimatedValue for ColorSpace

source§

impl ToAnimatedValue for HueInterpolationMethod

source§

impl ToAnimatedValue for ComputedUrl

source§

impl ToAnimatedValue for Impossible

source§

impl ToAnimatedValue for FillRule

source§

impl ToAnimatedValue for ShapeBox

source§

impl ToAnimatedValue for ShapeGeometryBoxwhere ShapeBox: ToAnimatedValue<AnimatedValue = ShapeBox>,

source§

impl ToAnimatedValue for RaySize

source§

impl ToAnimatedValue for FontSizeKeyword

source§

impl ToAnimatedValue for CoordBox

source§

impl ToAnimatedValue for TransformBox

source§

impl ToAnimatedValue for ColorInterpolationMethodwhere ColorSpace: ToAnimatedValue<AnimatedValue = ColorSpace>, HueInterpolationMethod: ToAnimatedValue<AnimatedValue = HueInterpolationMethod>,

source§

impl ToAnimatedValue for AbsoluteColor

source§

impl ToAnimatedValue for ComputedList

source§

impl ToAnimatedValue for Angle

source§

impl ToAnimatedValue for Zoom

source§

impl ToAnimatedValue for FontSize

source§

impl ToAnimatedValue for FontStretch

source§

impl ToAnimatedValue for style::values::computed::font::FontStyle

source§

impl ToAnimatedValue for FontWeight

source§

impl ToAnimatedValue for CSSPixelLengthwhere CSSFloat: ToAnimatedValue<AnimatedValue = CSSFloat>,

source§

impl ToAnimatedValue for LengthPercentage

source§

impl ToAnimatedValue for Percentagewhere CSSFloat: ToAnimatedValue<AnimatedValue = CSSFloat>,

source§

impl ToAnimatedValue for Au

source§

impl ToAnimatedValue for LetterSpacingwhere Length: ToAnimatedValue<AnimatedValue = Length>,

source§

impl ToAnimatedValue for Pathwhere FillRule: ToAnimatedValue<AnimatedValue = FillRule>, SVGPathData: ToAnimatedValue<AnimatedValue = SVGPathData>,

source§

impl ToAnimatedValue for ColorMixFlags

source§

impl ToAnimatedValue for KeywordInfowhere FontSizeKeyword: ToAnimatedValue<AnimatedValue = FontSizeKeyword>, f32: ToAnimatedValue<AnimatedValue = f32>, CSSPixelLength: ToAnimatedValue<AnimatedValue = CSSPixelLength>,

source§

impl ToAnimatedValue for SVGPathData

source§

impl ToAnimatedValue for Image

source§

impl ToAnimatedValue for NonNegativeLength

source§

impl ToAnimatedValue for NonNegativeLengthPercentage

source§

impl ToAnimatedValue for NonNegativePercentage

source§

impl ToAnimatedValue for GreaterThanOrEqualToOneNumber

source§

impl ToAnimatedValue for NonNegativeNumber

source§

impl ToAnimatedValue for NonNegativeNumberOrPercentage

source§

impl ToAnimatedValue for PositiveInteger

source§

impl ToAnimatedValue for ZeroToOneNumber

source§

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

source§

impl<Angle> ToAnimatedValue for style::values::generics::font::FontStyle<Angle>where Angle: ToAnimatedValue,

source§

impl<Angle, NonNegativeFactor, ZeroToOneFactor, Length, Shadow, U> ToAnimatedValue for GenericFilter<Angle, NonNegativeFactor, ZeroToOneFactor, Length, Shadow, U>where Angle: ToAnimatedValue, NonNegativeFactor: ToAnimatedValue, ZeroToOneFactor: ToAnimatedValue, Length: ToAnimatedValue, Shadow: ToAnimatedValue, U: ToAnimatedValue,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<Color, Percentage> ToAnimatedValue for GenericColorMix<Color, Percentage>where Color: ToAnimatedValue, Percentage: ToAnimatedValue,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<H, V> ToAnimatedValue for GenericOffsetPosition<H, V>where H: ToAnimatedValue, V: ToAnimatedValue,

source§

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

source§

impl<I> ToAnimatedValue for GenericLineClamp<I>where I: ToAnimatedValue,

source§

impl<L> ToAnimatedValue for GenericContainIntrinsicSize<L>where L: ToAnimatedValue,

source§

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

source§

impl<L> ToAnimatedValue for GenericSVGStrokeDashArray<L>where L: ToAnimatedValue,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<LengthOrAuto> ToAnimatedValue for GenericClipRect<LengthOrAuto>where LengthOrAuto: ToAnimatedValue,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<LengthPercentage> ToAnimatedValue for GenericPolygon<LengthPercentage>where LengthPercentage: ToAnimatedValue,

source§

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

source§

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

source§

impl<LengthPercentage, NonNegativeLengthPercentage> ToAnimatedValue for GenericInsetRect<LengthPercentage, NonNegativeLengthPercentage>where LengthPercentage: ToAnimatedValue, NonNegativeLengthPercentage: ToAnimatedValue,

§

type AnimatedValue = GenericInsetRect<<LengthPercentage as ToAnimatedValue>::AnimatedValue, <NonNegativeLengthPercentage as ToAnimatedValue>::AnimatedValue>

source§

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

source§

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

source§

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

§

type AnimatedValue = GenericShapeRadius<<NonNegativeLengthPercentage as ToAnimatedValue>::AnimatedValue>

source§

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

source§

impl<Percentage> ToAnimatedValue for GenericColor<Percentage>where Percentage: ToAnimatedValue,

source§

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

source§

impl<Position, LengthPercentage, NonNegativeLengthPercentage, BasicShapeRect> ToAnimatedValue for GenericBasicShape<Position, LengthPercentage, NonNegativeLengthPercentage, BasicShapeRect>where Position: ToAnimatedValue, LengthPercentage: ToAnimatedValue, NonNegativeLengthPercentage: ToAnimatedValue, BasicShapeRect: ToAnimatedValue,

§

type AnimatedValue = GenericBasicShape<<Position as ToAnimatedValue>::AnimatedValue, <LengthPercentage as ToAnimatedValue>::AnimatedValue, <NonNegativeLengthPercentage as ToAnimatedValue>::AnimatedValue, <BasicShapeRect as ToAnimatedValue>::AnimatedValue>

source§

impl<Position, NonNegativeLengthPercentage> ToAnimatedValue for Circle<Position, NonNegativeLengthPercentage>where Position: ToAnimatedValue, NonNegativeLengthPercentage: ToAnimatedValue,

§

type AnimatedValue = Circle<<Position as ToAnimatedValue>::AnimatedValue, <NonNegativeLengthPercentage as ToAnimatedValue>::AnimatedValue>

source§

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

§

type AnimatedValue = Ellipse<<Position as ToAnimatedValue>::AnimatedValue, <NonNegativeLengthPercentage as ToAnimatedValue>::AnimatedValue>

source§

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

source§

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

source§

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

source§

impl<Shapes, RayFunction, U> ToAnimatedValue for GenericOffsetPathFunction<Shapes, RayFunction, U>where Shapes: ToAnimatedValue, RayFunction: ToAnimatedValue, U: ToAnimatedValue,

source§

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

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::animation_composition::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::animation_delay::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::animation_direction::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::animation_duration::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::animation_fill_mode::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::animation_iteration_count::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::animation_name::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::animation_play_state::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::animation_timeline::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::animation_timing_function::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::background_attachment::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::background_clip::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::background_image::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::background_origin::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::background_position_x::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::background_position_y::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::background_repeat::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::background_size::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::box_shadow::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::filter::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::text_shadow::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::transition_behavior::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::transition_delay::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::transition_duration::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::transition_property::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for style::properties::generated::longhands::transition_timing_function::computed_value::OwnedList<T>where T: ToAnimatedValue,

source§

impl<T> ToAnimatedValue for OwnedSlice<T>where T: ToAnimatedValue,

source§

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

source§

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