Trait style::values::animated::ToAnimatedZero
source · 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§
sourcefn to_animated_zero(&self) -> Result<Self, ()>
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.
Object Safety§
Implementations on Foreign Types§
source§impl ToAnimatedZero for f32
impl ToAnimatedZero for f32
fn to_animated_zero(&self) -> Result<Self, ()>
source§impl ToAnimatedZero for f64
impl ToAnimatedZero for f64
fn to_animated_zero(&self) -> Result<Self, ()>
source§impl ToAnimatedZero for i32
impl ToAnimatedZero for i32
fn to_animated_zero(&self) -> Result<Self, ()>
source§impl<T> ToAnimatedZero for Option<T>where
T: ToAnimatedZero,
impl<T> ToAnimatedZero for Option<T>where
T: ToAnimatedZero,
fn to_animated_zero(&self) -> Result<Self, ()>
source§impl<T> ToAnimatedZero for ThinVec<T>where
T: ToAnimatedZero,
impl<T> ToAnimatedZero for ThinVec<T>where
T: ToAnimatedZero,
fn to_animated_zero(&self) -> Result<Self, ()>
source§impl<T> ToAnimatedZero for Box<[T]>where
T: ToAnimatedZero,
impl<T> ToAnimatedZero for Box<[T]>where
T: ToAnimatedZero,
fn to_animated_zero(&self) -> Result<Self, ()>
source§impl<T> ToAnimatedZero for Box<T>where
T: ToAnimatedZero,
impl<T> ToAnimatedZero for Box<T>where
T: ToAnimatedZero,
fn to_animated_zero(&self) -> Result<Self, ()>
source§impl<T> ToAnimatedZero for Vec<T>where
T: ToAnimatedZero,
impl<T> ToAnimatedZero for Vec<T>where
T: ToAnimatedZero,
fn to_animated_zero(&self) -> Result<Self, ()>
Implementors§
impl ToAnimatedZero for AnimationValue
impl ToAnimatedZero for T
impl ToAnimatedZero for AngleOrPercentage
impl ToAnimatedZero for NumberOrPercentage
impl ToAnimatedZero for CalcLengthPercentageLeaf
impl ToAnimatedZero for ArcSize
impl ToAnimatedZero for ArcSweep
impl ToAnimatedZero for ByTo
impl ToAnimatedZero for MinMaxOp
impl ToAnimatedZero for ModRemOp
impl ToAnimatedZero for RoundingStrategy
impl ToAnimatedZero for FontSizeKeyword
impl ToAnimatedZero for DProperty
impl ToAnimatedZero for AbsoluteColor
impl ToAnimatedZero for style::properties::generated::longhands::background_position_x::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl ToAnimatedZero for style::properties::generated::longhands::background_position_y::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl ToAnimatedZero for style::properties::generated::longhands::background_size::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl ToAnimatedZero for style::properties::generated::longhands::box_shadow::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl ToAnimatedZero for style::properties::generated::longhands::filter::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl ToAnimatedZero for style::properties::generated::longhands::text_shadow::computed_value::OwnedList<<T as ToAnimatedValue>::AnimatedValue>
impl ToAnimatedZero for Angle
impl ToAnimatedZero for FontSize
impl ToAnimatedZero for CSSPixelLength
impl ToAnimatedZero for CalcLengthPercentage
impl ToAnimatedZero for LengthPercentage
impl ToAnimatedZero for OffsetRotate
impl ToAnimatedZero for Percentage
impl ToAnimatedZero for Au
impl ToAnimatedZero for KeywordInfo
impl ToAnimatedZero for SVGPathData
impl ToAnimatedZero for FontVariationSettings
impl ToAnimatedZero for Transform
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