pub struct SpringBuilder<Value> { /* private fields */ }Expand description
Unvalidated spring configuration; SpringBuilder::build reports invalid parameters.
Implementations§
Source§impl<Value> SpringBuilder<Value>
impl<Value> SpringBuilder<Value>
Sourcepub fn stiffness(self, stiffness: f64) -> Self
pub fn stiffness(self, stiffness: f64) -> Self
Sets stiffness, which must be finite and positive.
Sourcepub fn damping(self, damping: f64) -> Self
pub fn damping(self, damping: f64) -> Self
Sets damping, which must be finite and strictly positive. Zero has no finite settling time.
Sourcepub fn initial_velocity(self, velocity: f64) -> Self
pub fn initial_velocity(self, velocity: f64) -> Self
Sets finite normalized velocity towards the target; negative moves away. Units are endpoint distances per second, not pixels per second.
Sourcepub fn settling_threshold(self, threshold: f64) -> Self
pub fn settling_threshold(self, threshold: f64) -> Self
Sets a finite relative displacement-envelope threshold strictly between zero and one. This is not a pixel tolerance or a velocity threshold.
Sourcepub fn build(self) -> Result<Spring<Value>, ValidationError>
pub fn build(self) -> Result<Spring<Value>, ValidationError>
Validates the configuration and computes the finite response.
Trait Implementations§
Source§impl<Value: Clone> Clone for SpringBuilder<Value>
impl<Value: Clone> Clone for SpringBuilder<Value>
Auto Trait Implementations§
impl<Value> Forget for SpringBuilder<Value>
impl<Value> Freeze for SpringBuilder<Value>where
Value: Freeze,
impl<Value> Move for SpringBuilder<Value>
impl<Value> RefUnwindSafe for SpringBuilder<Value>where
Value: RefUnwindSafe,
impl<Value> Send for SpringBuilder<Value>where
Value: Send,
impl<Value> Sync for SpringBuilder<Value>where
Value: Sync,
impl<Value> Unpin for SpringBuilder<Value>where
Value: Unpin,
impl<Value> UnsafeUnpin for SpringBuilder<Value>where
Value: UnsafeUnpin,
impl<Value> UnwindSafe for SpringBuilder<Value>where
Value: 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