pub struct SpringAnimation { /* private fields */ }Expand description
Spring-based animation for physics-like motion.
Implementations§
Source§impl SpringAnimation
impl SpringAnimation
Sourcepub const fn with_config(initial: f32, config: SpringConfig) -> Self
pub const fn with_config(initial: f32, config: SpringConfig) -> Self
Create with custom spring config.
Sourcepub fn set_target(&mut self, target: f32)
pub fn set_target(&mut self, target: f32)
Set the target position.
Sourcepub fn set_immediate(&mut self, position: f32)
pub fn set_immediate(&mut self, position: f32)
Set position immediately without animation.
Sourcepub fn is_at_rest(&self) -> bool
pub fn is_at_rest(&self) -> bool
Check if the animation is at rest.
Sourcepub fn advance_ms(&mut self, delta_ms: u32)
pub fn advance_ms(&mut self, delta_ms: u32)
Advance by delta milliseconds.
Trait Implementations§
Source§impl Clone for SpringAnimation
impl Clone for SpringAnimation
Source§fn clone(&self) -> SpringAnimation
fn clone(&self) -> SpringAnimation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SpringAnimation
impl RefUnwindSafe for SpringAnimation
impl Send for SpringAnimation
impl Sync for SpringAnimation
impl Unpin for SpringAnimation
impl UnwindSafe for SpringAnimation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more