pub struct Spring<T: Animatable> { /* private fields */ }Expand description
An animation driven by a damped spring simulation.
Implementations§
Source§impl<T: Animatable> Spring<T>
impl<T: Animatable> Spring<T>
Sourcepub fn new(from: T, to: T, config: SpringConfig) -> Self
pub fn new(from: T, to: T, config: SpringConfig) -> Self
Creates a running spring animation from from to to.
Trait Implementations§
Source§impl<T: Animatable> Animation<T> for Spring<T>
impl<T: Animatable> Animation<T> for Spring<T>
Source§fn state(&self) -> AnimationState
fn state(&self) -> AnimationState
Returns the animation’s lifecycle state.
Source§fn retarget(&mut self, target: &T) -> bool
fn retarget(&mut self, target: &T) -> bool
Attempts to continue the animation toward a new target. Read more
Source§fn duration(&self) -> Option<Duration>
fn duration(&self) -> Option<Duration>
Returns the total duration when it is finite and known.
Auto Trait Implementations§
impl<T> Freeze for Spring<T>where
T: Freeze,
impl<T> RefUnwindSafe for Spring<T>where
T: RefUnwindSafe,
impl<T> Send for Spring<T>where
T: Send,
impl<T> Sync for Spring<T>where
T: Sync,
impl<T> Unpin for Spring<T>where
T: Unpin,
impl<T> UnsafeUnpin for Spring<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Spring<T>where
T: UnwindSafe,
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