pub struct AnimationSpec {
pub duration: Duration,
pub easing: Easing,
pub delay: Duration,
pub spring: Option<SpringSpec>,
pub repeat: Option<RepeatableSpec>,
}Fields§
§duration: Duration§easing: Easing§delay: Duration§spring: Option<SpringSpec>If set, use true physical spring simulation (duration is ignored, emergent from physics).
repeat: Option<RepeatableSpec>If set, wrap the animation in repeat behavior (n iterations, optional ping-pong).
Implementations§
Source§impl AnimationSpec
impl AnimationSpec
pub fn tween(duration: Duration, easing: Easing) -> Self
Sourcepub fn spring(spring: SpringSpec) -> Self
pub fn spring(spring: SpringSpec) -> Self
True physical spring simulation - duration is emergent, no fixed duration needed.
Sourcepub fn spring_gentle() -> Self
pub fn spring_gentle() -> Self
Gentle underdamped preset (small overshoot). Uses true spring physics.
Sourcepub fn spring_bouncy() -> Self
pub fn spring_bouncy() -> Self
Bouncier underdamped preset. Uses true spring physics.
Sourcepub fn spring_crit(omega: f32) -> Self
pub fn spring_crit(omega: f32) -> Self
Critically damped spring with given omega (angular frequency). Uses true spring physics.
pub fn fast() -> Self
pub fn slow() -> Self
Sourcepub fn repeated(self, repeat: RepeatableSpec) -> Self
pub fn repeated(self, repeat: RepeatableSpec) -> Self
Wrap this spec in a repeatable animation.
Pass RepeatableSpec::infinite() for infinite repeats.
Trait Implementations§
Source§impl Clone for AnimationSpec
impl Clone for AnimationSpec
Source§fn clone(&self) -> AnimationSpec
fn clone(&self) -> AnimationSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AnimationSpec
Source§impl Debug for AnimationSpec
impl Debug for AnimationSpec
Auto Trait Implementations§
impl Freeze for AnimationSpec
impl RefUnwindSafe for AnimationSpec
impl Send for AnimationSpec
impl Sync for AnimationSpec
impl Unpin for AnimationSpec
impl UnsafeUnpin for AnimationSpec
impl UnwindSafe for AnimationSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more