pub trait ToAnimatedValue {
    type AnimatedValue;

    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 Option<T>where
    T: ToAnimatedValue,

source§

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

source§

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

source§

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

source§

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

source§

impl ToAnimatedValue for bool

source§

impl ToAnimatedValue for f32

Implementors§

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 ColorSpace

source§

impl ToAnimatedValue for HueInterpolationMethod

source§

impl ToAnimatedValue for FontSizeKeyword

source§

impl ToAnimatedValue for ComputedList

source§

impl ToAnimatedValue for ComputedAngle

source§

impl ToAnimatedValue for FontSize

source§

impl ToAnimatedValue for FontStretch

source§

impl ToAnimatedValue for FontStyleAngle

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 ColorInterpolationMethodwhere
    ColorSpace: ToAnimatedValue<AnimatedValue = ColorSpace>,
    HueInterpolationMethod: ToAnimatedValue<AnimatedValue = HueInterpolationMethod>,

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 Auto

source§

impl ToAnimatedValue for None_

source§

impl ToAnimatedValue for style::values::RGBA

source§

impl ToAnimatedValue for style::values::animated::color::RGBAwhere
    f32: ToAnimatedValue<AnimatedValue = f32>,

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 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<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<H, V> ToAnimatedValue for GenericPosition<H, V>where
    H: ToAnimatedValue,
    V: ToAnimatedValue,

source§

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

source§

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

source§

impl<H, V, NonNegativeLengthPercentage> ToAnimatedValue for Ellipse<H, V, NonNegativeLengthPercentage>where
    H: ToAnimatedValue,
    V: ToAnimatedValue,
    NonNegativeLengthPercentage: 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 InsetRect<LengthPercentage, NonNegativeLengthPercentage>where
    LengthPercentage: ToAnimatedValue,
    NonNegativeLengthPercentage: ToAnimatedValue,

§

type AnimatedValue = InsetRect<<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<Number> ToAnimatedValue for GenericFontSizeAdjust<Number>where
    Number: ToAnimatedValue,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<T> ToAnimatedValue for style::properties::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,