pub trait CommonAnimationExt: AnimationExt {
// Provided methods
fn with_rotate_animation(self, duration: u64) -> AnimationElement<Self>
where Self: Transformable + Sized { ... }
fn with_keyed_rotate_animation(
self,
id: impl Into<ElementId>,
duration: u64,
) -> AnimationElement<Self>
where Self: Transformable + Sized { ... }
}Expand description
An extension trait for adding common animations to animatable components.
Provided Methods§
Sourcefn with_rotate_animation(self, duration: u64) -> AnimationElement<Self>where
Self: Transformable + Sized,
fn with_rotate_animation(self, duration: u64) -> AnimationElement<Self>where
Self: Transformable + Sized,
Render this component as rotating over the given duration.
NOTE: This method uses the location of the caller to generate an ID for this state.
If this is not sufficient to identify your state (e.g. you’re rendering a list item),
you can provide a custom ElementID using the use_keyed_rotate_animation method.
Sourcefn with_keyed_rotate_animation(
self,
id: impl Into<ElementId>,
duration: u64,
) -> AnimationElement<Self>where
Self: Transformable + Sized,
fn with_keyed_rotate_animation(
self,
id: impl Into<ElementId>,
duration: u64,
) -> AnimationElement<Self>where
Self: Transformable + Sized,
Render this component as rotating with the given element ID over the given duration.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".