pub struct Spring {
pub value: f64,
pub target: f64,
pub velocity: f64,
pub config: SpringConfig,
pub at_rest: bool,
pub precision: f64,
}Expand description
A spring-animated value.
Fields§
§value: f64Current value
target: f64Target value
velocity: f64Current velocity
config: SpringConfigSpring configuration
at_rest: boolWhether animation is complete
precision: f64Precision threshold for settling
Implementations§
Source§impl Spring
impl Spring
Sourcepub fn with_config(self, config: SpringConfig) -> Self
pub fn with_config(self, config: SpringConfig) -> Self
Set spring configuration.
Sourcepub fn set_target(&mut self, target: f64)
pub fn set_target(&mut self, target: f64)
Set target value.
Sourcepub fn set_immediate(&mut self, value: f64)
pub fn set_immediate(&mut self, value: f64)
Immediately set value without animation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Spring
impl RefUnwindSafe for Spring
impl Send for Spring
impl Sync for Spring
impl Unpin for Spring
impl UnwindSafe for Spring
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