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

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]

[src]

impl ToAnimatedZero for f64
[src]

[src]

impl ToAnimatedZero for i32
[src]

[src]

impl<T> ToAnimatedZero for Option<T> where
    T: ToAnimatedZero
[src]

[src]

Implementors