Trait style::values::animated::ToAnimatedValue
[−]
[src]
pub trait ToAnimatedValue { type AnimatedValue; fn to_animated_value(self) -> Self::AnimatedValue; fn from_animated_value(animated: Self::AnimatedValue) -> Self; }
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)]
.
Associated Types
type AnimatedValue
The type of the animated value.
Required Methods
fn to_animated_value(self) -> Self::AnimatedValue
Converts this value to an animated value.
fn from_animated_value(animated: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.
Implementations on Foreign Types
impl<T> ToAnimatedValue for Option<T> where
T: ToAnimatedValue,
[src]
T: ToAnimatedValue,
type AnimatedValue = Option<<T as ToAnimatedValue>::AnimatedValue>
fn to_animated_value(self) -> Self::AnimatedValue
[src]
fn from_animated_value(animated: Self::AnimatedValue) -> Self
[src]
impl<T> ToAnimatedValue for Vec<T> where
T: ToAnimatedValue,
[src]
T: ToAnimatedValue,
type AnimatedValue = Vec<<T as ToAnimatedValue>::AnimatedValue>
fn to_animated_value(self) -> Self::AnimatedValue
[src]
fn from_animated_value(animated: Self::AnimatedValue) -> Self
[src]
impl<T> ToAnimatedValue for SmallVec<[T; 1]> where
T: ToAnimatedValue,
[src]
T: ToAnimatedValue,
type AnimatedValue = SmallVec<[T::AnimatedValue; 1]>
fn to_animated_value(self) -> Self::AnimatedValue
[src]
fn from_animated_value(animated: Self::AnimatedValue) -> Self
[src]
Implementors
impl ToAnimatedValue for ComputedBoxShadowList type AnimatedValue = BoxShadowList;
impl ToAnimatedValue for ComputedTextShadowList type AnimatedValue = TextShadowList;
impl ToAnimatedValue for ComputedFilterList type AnimatedValue = FilterList;
impl<T> ToAnimatedValue for T where
T: AnimatedValueAsComputed, type AnimatedValue = Self;impl ToAnimatedValue for ComputedNonNegativeNumber type AnimatedValue = Self;
impl ToAnimatedValue for ComputedGreaterThanOrEqualToOneNumber type AnimatedValue = Self;
impl ToAnimatedValue for ComputedNonNegativeLength type AnimatedValue = Self;
impl ToAnimatedValue for ComputedPositiveInteger type AnimatedValue = Self;
impl ToAnimatedValue for ComputedNonNegativeLengthOrPercentage type AnimatedValue = Self;
impl ToAnimatedValue for ComputedBorderCornerRadius type AnimatedValue = Self;
impl ToAnimatedValue for ComputedMaxLength type AnimatedValue = Self;
impl ToAnimatedValue for ComputedMozLength type AnimatedValue = Self;
impl ToAnimatedValue for BackgroundSize type AnimatedValue = Self;
impl ToAnimatedValue for BackgroundSizeList type AnimatedValue = Self;
impl ToAnimatedValue for Color type AnimatedValue = AnimatedColor;
impl ToAnimatedValue for RGBA type AnimatedValue = AnimatedRGBA;
impl ToAnimatedValue for KeywordInfo type AnimatedValue = KeywordInfo;
impl ToAnimatedValue for FontSize type AnimatedValue = NonNegativeLength;
impl ToAnimatedValue for FontSizeAdjust type AnimatedValue = Self;
impl ToAnimatedValue for CSSPixelLength type AnimatedValue = CSSPixelLength;
impl<L> ToAnimatedValue for BorderSpacing<L> where
Size<L>: ToAnimatedValue<AnimatedValue = Size<<L as ToAnimatedValue>::AnimatedValue>>,
L: ToAnimatedValue, type AnimatedValue = BorderSpacing<<L as ToAnimatedValue>::AnimatedValue>;impl<Color, SizeLength, BlurShapeLength, ShapeLength> ToAnimatedValue for BoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> where
SimpleShadow<Color, SizeLength, BlurShapeLength>: ToAnimatedValue<AnimatedValue = SimpleShadow<<Color as ToAnimatedValue>::AnimatedValue, <SizeLength as ToAnimatedValue>::AnimatedValue, <BlurShapeLength as ToAnimatedValue>::AnimatedValue>>,
BlurShapeLength: ToAnimatedValue,
Color: ToAnimatedValue,
SizeLength: ToAnimatedValue,
ShapeLength: ToAnimatedValue, type AnimatedValue = BoxShadow<<Color as ToAnimatedValue>::AnimatedValue, <SizeLength as ToAnimatedValue>::AnimatedValue, <BlurShapeLength as ToAnimatedValue>::AnimatedValue, <ShapeLength as ToAnimatedValue>::AnimatedValue>;impl<Angle, Factor, Length, DropShadow> ToAnimatedValue for Filter<Angle, Factor, Length, DropShadow> where
Length: ToAnimatedValue,
Factor: ToAnimatedValue,
Angle: ToAnimatedValue,
DropShadow: ToAnimatedValue, type AnimatedValue = Filter<<Angle as ToAnimatedValue>::AnimatedValue, <Factor as ToAnimatedValue>::AnimatedValue, <Length as ToAnimatedValue>::AnimatedValue, <DropShadow as ToAnimatedValue>::AnimatedValue>;impl<Color, SizeLength, ShapeLength> ToAnimatedValue for SimpleShadow<Color, SizeLength, ShapeLength> where
Color: ToAnimatedValue,
SizeLength: ToAnimatedValue,
ShapeLength: ToAnimatedValue, type AnimatedValue = SimpleShadow<<Color as ToAnimatedValue>::AnimatedValue, <SizeLength as ToAnimatedValue>::AnimatedValue, <ShapeLength as ToAnimatedValue>::AnimatedValue>;impl<L> ToAnimatedValue for Size<L> where
L: ToAnimatedValue, type AnimatedValue = Size<L::AnimatedValue>;impl<ColorType, UrlPaintServer> ToAnimatedValue for SVGPaint<ColorType, UrlPaintServer> where
SVGPaintKind<ColorType, UrlPaintServer>: ToAnimatedValue<AnimatedValue = SVGPaintKind<<ColorType as ToAnimatedValue>::AnimatedValue, <UrlPaintServer as ToAnimatedValue>::AnimatedValue>>,
UrlPaintServer: ToAnimatedValue,
ColorType: ToAnimatedValue,
Option<Either<ColorType, None_>>: ToAnimatedValue<AnimatedValue = Option<Either<<ColorType as ToAnimatedValue>::AnimatedValue, None_>>>, type AnimatedValue = SVGPaint<<ColorType as ToAnimatedValue>::AnimatedValue, <UrlPaintServer as ToAnimatedValue>::AnimatedValue>;impl<ColorType, UrlPaintServer> ToAnimatedValue for SVGPaintKind<ColorType, UrlPaintServer> where
ColorType: ToAnimatedValue,
UrlPaintServer: ToAnimatedValue, type AnimatedValue = SVGPaintKind<<ColorType as ToAnimatedValue>::AnimatedValue, <UrlPaintServer as ToAnimatedValue>::AnimatedValue>;impl<LengthOrPercentage, Number> ToAnimatedValue for SvgLengthOrPercentageOrNumber<LengthOrPercentage, Number> where
LengthOrPercentage: ToAnimatedValue,
Number: ToAnimatedValue, type AnimatedValue = SvgLengthOrPercentageOrNumber<<LengthOrPercentage as ToAnimatedValue>::AnimatedValue, <Number as ToAnimatedValue>::AnimatedValue>;impl<LengthType> ToAnimatedValue for SVGLength<LengthType> where
LengthType: ToAnimatedValue, type AnimatedValue = SVGLength<<LengthType as ToAnimatedValue>::AnimatedValue>;impl<LengthType> ToAnimatedValue for SVGStrokeDashArray<LengthType> where
Vec<LengthType>: ToAnimatedValue<AnimatedValue = Vec<<LengthType as ToAnimatedValue>::AnimatedValue>>,
LengthType: ToAnimatedValue, type AnimatedValue = SVGStrokeDashArray<<LengthType as ToAnimatedValue>::AnimatedValue>;impl<Number, LengthOrPercentage> ToAnimatedValue for LineHeight<Number, LengthOrPercentage> where
Number: ToAnimatedValue,
LengthOrPercentage: ToAnimatedValue, type AnimatedValue = LineHeight<<Number as ToAnimatedValue>::AnimatedValue, <LengthOrPercentage as ToAnimatedValue>::AnimatedValue>;impl ToAnimatedValue for KeywordSize type AnimatedValue = KeywordSize;
impl<A, B> ToAnimatedValue for Either<A, B> where
A: ToAnimatedValue,
B: ToAnimatedValue, type AnimatedValue = Either<<A as ToAnimatedValue>::AnimatedValue, <B as ToAnimatedValue>::AnimatedValue>;