# MaterialSpringState

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-themes-material/motion/struct-materialspringstate/

**struct** · [`ferroui-themes-material`](/docs/0.5.0/api/ferroui-themes-material/) · v0.5.0

```rust
struct MaterialSpringState
```

A velocity-continuous spring for interactive controls whose target may change mid-flight.

Call `Self::advance` with frame time, then `Self::retarget` on an input change. Retargeting
preserves both the current position and its physical velocity, including when the target
reverses direction. No allocations or numerical integration are involved.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/motion.rs#L438)

## Members

- [`new`](#function-new)
- [`current`](#function-current)
- [`target`](#function-target)
- [`retarget`](#function-retarget)
- [`set_spec`](#function-set_spec)
- [`set_reduced_motion`](#function-set_reduced_motion)
- [`advance`](#function-advance)
- [`is_at_rest`](#function-is_at_rest)
- [`finish`](#function-finish)

<a id="function-new"></a>

### new

```rust
fn new(spec: MaterialSpringSpec, value: f64) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/motion.rs#L448)

<a id="function-current"></a>

### current

```rust
fn current(self: &Self) -> MaterialSpringSample
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/motion.rs#L464)

<a id="function-target"></a>

### target

```rust
fn target(self: &Self) -> f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/motion.rs#L468)

<a id="function-retarget"></a>

### retarget

```rust
fn retarget(self: &mut Self, target: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/motion.rs#L472)

<a id="function-set_spec"></a>

### set_spec

```rust
fn set_spec(self: &mut Self, spec: MaterialSpringSpec)
```

Changes the motion scheme without discontinuously resetting the live state.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/motion.rs#L486)

<a id="function-set_reduced_motion"></a>

### set_reduced_motion

```rust
fn set_reduced_motion(self: &mut Self, reduced_motion: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/motion.rs#L492)

<a id="function-advance"></a>

### advance

```rust
fn advance(self: &mut Self, seconds: f64) -> MaterialSpringSample
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/motion.rs#L499)

<a id="function-is_at_rest"></a>

### is_at_rest

```rust
fn is_at_rest(self: &Self, position_threshold: f64, velocity_threshold: f64) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/motion.rs#L514)

<a id="function-finish"></a>

### finish

```rust
fn finish(self: &mut Self)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/motion.rs#L519)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `CastableFrom<ST, Uninit, Uninit>`
- `CastableFrom<ST, Initialized, Initialized>`
- `Read<Exclusive, BecauseExclusive>`
- `Clone`
- `Copy`
- `Debug`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
