# Easing

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/animation/easings/struct-easing/

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

```rust
struct Easing
```

An easing function: the shared, type-erased handle that animations and
transitions hold.

Any [`IEasing`](/docs/0.5.0/api/ferroui-base/animation/easings/trait-ieasing/) converts into an `Easing` (`LinearEasing::new().into()`).
To keep mutating an easing after handing it out (for example the control
points of a [`SplineEasing`](/docs/0.5.0/api/ferroui-base/animation/easings/struct-splineeasing/)), create it behind an `Rc` and use
`from_rc`. Handles compare by identity.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/easing.rs#L16)

## Members

- [`new`](#function-new)
- [`from_rc`](#function-from_rc)
- [`as_rc`](#function-as_rc)
- [`ease`](#function-ease)
- [`parse`](#function-parse)

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

### new

```rust
fn new(easing: impl IEasing) -> Self
```

Wraps an easing function.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/easing.rs#L20)

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

### from_rc

```rust
fn from_rc(easing: Rc<dyn IEasing>) -> Self
```

Wraps a shared easing function.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/easing.rs#L25)

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

### as_rc

```rust
fn as_rc(self: &Self) -> &Rc<dyn IEasing>
```

The wrapped easing function.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/easing.rs#L30)

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

### ease

```rust
fn ease(self: &Self, progress: f64) -> f64
```

Returns the transformed progress for a linear progress.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/easing.rs#L36)

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

### parse

```rust
fn parse(e: &str) -> Result<Easing, FormatError>
```

Parses an easing: either the four comma-separated control points of a
spline easing, or the name of one of the easing types of this module.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/easings/easing.rs#L42)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- [`IEasing`](/docs/0.5.0/api/ferroui-base/animation/easings/trait-ieasing/)
- `Default`
- `PartialEq`
- `Debug`
- `FromStr`
- `From<BackEaseIn>`
- `From<BackEaseInOut>`
- `From<BackEaseOut>`
- `From<BounceEaseIn>`
- `From<BounceEaseInOut>`
- `From<BounceEaseOut>`
- `From<CircularEaseIn>`
- `From<CircularEaseInOut>`
- `From<CircularEaseOut>`
- `From<CubicEaseIn>`
- `From<CubicEaseInOut>`
- `From<CubicEaseOut>`
- `From<ElasticEaseIn>`
- `From<ElasticEaseInOut>`
- `From<ElasticEaseOut>`
- `From<ExponentialEaseIn>`
- `From<ExponentialEaseInOut>`
- `From<ExponentialEaseOut>`
- `From<LinearEasing>`
- `From<QuadraticEaseIn>`
- `From<QuadraticEaseInOut>`
- `From<QuadraticEaseOut>`
- `From<QuarticEaseIn>`
- `From<QuarticEaseInOut>`
- `From<QuarticEaseOut>`
- `From<QuinticEaseIn>`
- `From<QuinticEaseInOut>`
- `From<QuinticEaseOut>`
- `From<SineEaseIn>`
- `From<SineEaseInOut>`
- `From<SineEaseOut>`
- `From<SplineEasing>`
- `From<SpringEasing>`
- `From<CubicBezierEasingFunction>`
- `From<Rc<CubicBezierEasingFunction>>`
- `From<LinearEasingFunction>`
- `From<Rc<LinearEasingFunction>>`
- `From<StepEasingFunction>`
- `From<Rc<StepEasingFunction>>`
- `From<BackEasingFunction>`
- `From<Rc<BackEasingFunction>>`
- `From<BounceEasingFunction>`
- `From<Rc<BounceEasingFunction>>`
- `From<CircleEasingFunction>`
- `From<Rc<CircleEasingFunction>>`
- `From<ElasticEasingFunction>`
- `From<Rc<ElasticEasingFunction>>`
- `From<ExponentialEasingFunction>`
- `From<Rc<ExponentialEasingFunction>>`
- `From<PowerEasingFunction>`
- `From<Rc<PowerEasingFunction>>`
- `From<SineEasingFunction>`
- `From<Rc<SineEasingFunction>>`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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