pub trait ToAnimatedZero: Sized {
    // Required method
    fn to_animated_zero(&self) -> Result<Self, ()>;
}
Expand description

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.

Trait bounds for type parameter Foo can be opted out of with #[animation(no_bound(Foo))] on the type definition.

Required Methods§

source

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§

source§

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

source§

fn to_animated_zero(&self) -> Result<Self, ()>

source§

impl ToAnimatedZero for f64

source§

fn to_animated_zero(&self) -> Result<Self, ()>

source§

impl ToAnimatedZero for f32

source§

fn to_animated_zero(&self) -> Result<Self, ()>

source§

impl ToAnimatedZero for i32

source§

fn to_animated_zero(&self) -> Result<Self, ()>

source§

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

source§

fn to_animated_zero(&self) -> Result<Self, ()>

source§

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

source§

fn to_animated_zero(&self) -> Result<Self, ()>

source§

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

source§

fn to_animated_zero(&self) -> Result<Self, ()>

Implementors§

source§

impl ToAnimatedZero for AnimationValue

source§

impl ToAnimatedZero for T

source§

impl ToAnimatedZero for AngleOrPercentage

source§

impl ToAnimatedZero for NumberOrPercentage

source§

impl ToAnimatedZero for CalcLengthPercentageLeaf

source§

impl ToAnimatedZero for MinMaxOp

source§

impl ToAnimatedZero for ModRemOp

source§

impl ToAnimatedZero for RoundingStrategy

source§

impl ToAnimatedZero for FontSizeKeyword

source§

impl ToAnimatedZero for DProperty

source§

impl ToAnimatedZero for IsAbsolute

source§

impl ToAnimatedZero for PathCommand

source§

impl ToAnimatedZero for AbsoluteColor

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl ToAnimatedZero for Angle

source§

impl ToAnimatedZero for FontSize

source§

impl ToAnimatedZero for CSSPixelLength

source§

impl ToAnimatedZero for CalcLengthPercentage

source§

impl ToAnimatedZero for LengthPercentage

source§

impl ToAnimatedZero for OffsetRotate

source§

impl ToAnimatedZero for Percentage

source§

impl ToAnimatedZero for Au

source§

impl ToAnimatedZero for LetterSpacing

source§

impl ToAnimatedZero for KeywordInfo

source§

impl ToAnimatedZero for ArcFlag

source§

impl ToAnimatedZero for CoordPair

source§

impl ToAnimatedZero for SVGPathData

source§

impl ToAnimatedZero for FontVariationSettings

source§

impl ToAnimatedZero for Transform

source§

impl ToAnimatedZero for TransformOperation

Build an equivalent ‘identity transform function list’ based on an existing transform list. http://dev.w3.org/csswg/css-transforms/#none-transform-animation

source§

impl ToAnimatedZero for GridTemplateComponent

source§

impl ToAnimatedZero for Color

source§

impl ToAnimatedZero for AnimatedFilter

source§

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

source§

impl<Angle> ToAnimatedZero for FontStyle<Angle>where Angle: ToAnimatedZero,

source§

impl<B, U> ToAnimatedZero for ClipPath<B, U>

source§

impl<B, U> ToAnimatedZero for ShapeOutside<B, U>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<Function> ToAnimatedZero for OffsetPath<Function>

source§

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

source§

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

source§

impl<H, V, Depth> ToAnimatedZero for GenericTransformOrigin<H, V, Depth>where H: ToAnimatedZero, V: ToAnimatedZero, Depth: ToAnimatedZero,

source§

impl<I> ToAnimatedZero for GenericZIndex<I>where I: ToAnimatedZero,

source§

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

source§

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

source§

impl<L> ToAnimatedZero for VerticalAlign<L>

source§

impl<L> ToAnimatedZero for GenericCalcNode<L>where L: ToAnimatedZero,

source§

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

source§

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

source§

impl<L> ToAnimatedZero for GenericTextDecorationLength<L>where L: ToAnimatedZero,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<LengthPercentage, Length> ToAnimatedZero for GenericTranslate<LengthPercentage, Length>where LengthPercentage: Zero + ZeroNoPercent + ToAnimatedZero, Length: Zero + ToAnimatedZero,

source§

impl<N> ToAnimatedZero for GenericNumberOrFromFont<N>where N: ToAnimatedZero,

source§

impl<N> ToAnimatedZero for AspectRatio<N>

source§

impl<N, L> ToAnimatedZero for LineHeight<N, L>

source§

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

source§

impl<Number> ToAnimatedZero for GenericScale<Number>where Number: ToAnimatedZero,

source§

impl<Number, Angle> ToAnimatedZero for GenericRotate<Number, Angle>where Number: ToAnimatedZero, Angle: ToAnimatedZero,

source§

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

source§

impl<OpacityType> ToAnimatedZero for GenericSVGOpacity<OpacityType>where OpacityType: ToAnimatedZero,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<T> ToAnimatedZero for ArcSlice<T>where T: ToAnimatedZero,

source§

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

source§

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

source§

impl<T> ToAnimatedZero for GreaterThanOrEqualToOne<T>where T: ToAnimatedZero,

source§

impl<T> ToAnimatedZero for NonNegative<T>where T: ToAnimatedZero,

source§

impl<T> ToAnimatedZero for ZeroToOne<T>where T: ToAnimatedZero,

source§

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