pub struct SpringSpec {
pub damping_ratio: f32,
pub stiffness: f32,
pub velocity_threshold: f32,
pub position_threshold: f32,
pub delay_millis: u64,
}Expand description
Spring animation configuration.
Fields§
§damping_ratio: f32Damping ratio. 1.0 = critically damped, < 1.0 = under-damped (bouncy), > 1.0 = over-damped.
stiffness: f32Stiffness constant. Higher values = faster animation.
velocity_threshold: f32Velocity threshold to stop animation.
position_threshold: f32Position threshold to stop animation.
delay_millis: u64Delay before the spring begins advancing.
Implementations§
Source§impl SpringSpec
impl SpringSpec
Sourcepub fn new(damping_ratio: f32, stiffness: f32) -> Self
pub fn new(damping_ratio: f32, stiffness: f32) -> Self
Create a spring with explicit Compose-style physics constants.
Sourcepub fn with_delay(self, delay_millis: u64) -> Self
pub fn with_delay(self, delay_millis: u64) -> Self
Add a delay before the spring starts integrating.
Sourcepub fn default_spring() -> Self
pub fn default_spring() -> Self
Create a spring with default material design values.
Trait Implementations§
Source§impl Clone for SpringSpec
impl Clone for SpringSpec
Source§fn clone(&self) -> SpringSpec
fn clone(&self) -> SpringSpec
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 SpringSpec
Source§impl Debug for SpringSpec
impl Debug for SpringSpec
Source§impl Default for SpringSpec
impl Default for SpringSpec
Source§impl PartialEq for SpringSpec
impl PartialEq for SpringSpec
impl StructuralPartialEq for SpringSpec
Auto Trait Implementations§
impl Freeze for SpringSpec
impl RefUnwindSafe for SpringSpec
impl Send for SpringSpec
impl Sync for SpringSpec
impl Unpin for SpringSpec
impl UnsafeUnpin for SpringSpec
impl UnwindSafe for SpringSpec
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