Trait style::values::animated::Animate [] [src]

pub trait Animate: Sized {
    fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>;
}

Animate from one value to another.

This trait is derivable with #[derive(Animate)]. The derived implementation uses a match expression with identical patterns for both self and other, calling Animate::animate on each fields of the values. If a field is annotated with #[animation(constant)], the two values should be equal or an error is returned.

If a variant is annotated with #[animation(error)], the corresponding match arm is not generated.

If the two values are not similar, an error is returned unless a fallback function has been specified through #[animate(fallback)].

Required Methods

Animate a value towards another one, given an animation procedure.

Implementations on Foreign Types

impl Animate for i32
[src]

https://drafts.csswg.org/css-transitions/#animtype-number

[src]

impl Animate for f32
[src]

https://drafts.csswg.org/css-transitions/#animtype-number

[src]

impl Animate for f64
[src]

https://drafts.csswg.org/css-transitions/#animtype-number

[src]

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

[src]

impl<T> Animate for Size2D<T> where
    T: Animate + Copy
[src]

[src]

impl<T> Animate for Point2D<T> where
    T: Animate + Copy
[src]

[src]

impl<T> Animate for SmallVec<[T; 1]> where
    T: RepeatableListAnimatable
[src]

[src]

impl<T> Animate for Vec<T> where
    T: RepeatableListAnimatable
[src]

[src]

Implementors