Trait style::values::animated::ToAnimatedZero
[−]
[src]
pub trait ToAnimatedZero: Sized { fn to_animated_zero(&self) -> Result<Self, ()>; }
Returns a value similar to self
that represents zero.
This trait is derivable with #[derive(ToAnimatedValue)]
. If a field is
annotated with #[animation(constant)]
, a clone of its value will be used
instead of calling ToAnimatedZero::to_animated_zero
on it.
If a variant is annotated with #[animation(error)]
, the corresponding
match
arm is not generated.
Required Methods
fn to_animated_zero(&self) -> Result<Self, ()>
Returns a value that, when added with an underlying value, will produce the underlying value. This is used for SMIL animation's "by-animation" where SMIL first interpolates from the zero value to the 'by' value, and then adds the result to the underlying value.
This is not the necessarily the same as the initial value of a property. For example, the initial value of 'stroke-width' is 1, but the zero value is 0, since adding 1 to the underlying value will not produce the underlying value.
Implementations on Foreign Types
impl ToAnimatedZero for f32
[src]
fn to_animated_zero(&self) -> Result<Self, ()>
[src]
impl ToAnimatedZero for f64
[src]
fn to_animated_zero(&self) -> Result<Self, ()>
[src]
impl ToAnimatedZero for i32
[src]
fn to_animated_zero(&self) -> Result<Self, ()>
[src]
impl<T> ToAnimatedZero for Option<T> where
T: ToAnimatedZero,
[src]
T: ToAnimatedZero,
fn to_animated_zero(&self) -> Result<Self, ()>
[src]
Implementors
impl ToAnimatedZero for RGBA
impl ToAnimatedZero for Color
impl<S> ToAnimatedZero for ShadowList<S>
impl ToAnimatedZero for FilterList
impl ToAnimatedZero for Au
impl ToAnimatedZero for Angle
impl ToAnimatedZero for BackgroundSize
impl ToAnimatedZero for BorderSpacing
impl ToAnimatedZero for BorderCornerRadius
impl ToAnimatedZero for FontSize
impl ToAnimatedZero for KeywordInfo
impl ToAnimatedZero for FontSizeAdjust
impl ToAnimatedZero for CalcLengthOrPercentage
impl ToAnimatedZero for LengthOrPercentage
impl ToAnimatedZero for CSSPixelLength
impl ToAnimatedZero for MozLength
impl ToAnimatedZero for Percentage
impl ToAnimatedZero for LineHeight
impl ToAnimatedZero for TransformOperation
impl ToAnimatedZero for Transform
impl<B, T, U> ToAnimatedZero for ShapeSource<B, T, U>
impl<L> ToAnimatedZero for VerticalAlign<L>
impl<Color, SizeLength, BlurShapeLength, ShapeLength> ToAnimatedZero for BoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> where
SimpleShadow<Color, SizeLength, BlurShapeLength>: ToAnimatedZero,
ShapeLength: ToAnimatedZero,impl<Color, SizeLength, ShapeLength> ToAnimatedZero for SimpleShadow<Color, SizeLength, ShapeLength> where
Color: ToAnimatedZero,
SizeLength: ToAnimatedZero,
ShapeLength: ToAnimatedZero,impl<H, V> ToAnimatedZero for Position<H, V> where
H: ToAnimatedZero,
V: ToAnimatedZero,impl<ColorType, UrlPaintServer> ToAnimatedZero for SVGPaintKind<ColorType, UrlPaintServer> where
ColorType: ToAnimatedZero,impl<LengthOrPercentage, Number> ToAnimatedZero for SvgLengthOrPercentageOrNumber<LengthOrPercentage, Number> where
LengthOrPercentage: ToAnimatedZero,
Number: ToAnimatedZero,impl<LengthType> ToAnimatedZero for SVGLength<LengthType> where
LengthType: ToAnimatedZero,impl<OpacityType> ToAnimatedZero for SVGOpacity<OpacityType> where
OpacityType: ToAnimatedZero,impl<V> ToAnimatedZero for Spacing<V> where
V: From<Au>,impl<H, V, Depth> ToAnimatedZero for TransformOrigin<H, V, Depth> where
H: ToAnimatedZero,
V: ToAnimatedZero,
Depth: ToAnimatedZero,impl<T> ToAnimatedZero for NonNegative<T> where
T: ToAnimatedZero,impl<T> ToAnimatedZero for GreaterThanOrEqualToOne<T> where
T: ToAnimatedZero,impl ToAnimatedZero for KeywordSize
impl ToAnimatedZero for None_
impl ToAnimatedZero for Auto
impl ToAnimatedZero for Normal
impl<A, B> ToAnimatedZero for Either<A, B> where
A: ToAnimatedZero,
B: ToAnimatedZero,impl ToAnimatedZero for style::properties::longhands::background_position_x::computed_value::T
impl ToAnimatedZero for style::properties::longhands::background_position_y::computed_value::T
impl ToAnimatedZero for style::properties::longhands::background_size::computed_value::T
impl ToAnimatedZero for AnimationValue
impl ToAnimatedZero for Visibility
impl ToAnimatedZero for LengthOrPercentageOrAuto
impl ToAnimatedZero for LengthOrPercentageOrNone
impl ToAnimatedZero for MaxLength
impl ToAnimatedZero for FontWeight
impl ToAnimatedZero for FontStretch
impl ToAnimatedZero for ClipRect
impl ToAnimatedZero for IntermediateSVGPaint
impl<L> ToAnimatedZero for SVGStrokeDashArray<L> where
L: ToAnimatedZero,impl ToAnimatedZero for AnimatedFilter