# ISuspensionDriver

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/interfaces/trait-isuspensiondriver/

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

```rust
trait ISuspensionDriver
```

A driver that loads and saves the state of the application to persistent storage
(`ISuspensionDriver`).

The driver owns the serialization: the state reaches it as the object itself, and it is free
to write it in any format. `DummySuspensionDriver` stores
nothing.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/interfaces/i_suspension_driver.rs#L17)

## Members

- [`load_state`](#function-load_state)
- [`save_state`](#function-save_state)
- [`invalidate_state`](#function-invalidate_state)

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

### load_state

```rust
fn load_state(self: &Self) -> Rc<dyn IObservable<Option<Rc<dyn Any>>>>
```

The persisted state of the application, or `None` when there is none (`LoadState()`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/interfaces/i_suspension_driver.rs#L19)

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

### save_state

```rust
fn save_state(self: &Self, state: Option<Rc<dyn Any>>) -> Rc<dyn IObservable<()>>
```

Saves the state of the application; the observable completes once it is saved
(`SaveState<T>(T)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/interfaces/i_suspension_driver.rs#L23)

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

### invalidate_state

```rust
fn invalidate_state(self: &Self) -> Rc<dyn IObservable<()>>
```

Invalidates the persisted state, for example by deleting it; the observable completes once
it is invalidated (`InvalidateState()`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/interfaces/i_suspension_driver.rs#L27)

## Trait implementations

- [`ISuspensionDriver`](/docs/0.5.0/api/ferroui-reactiveui/interfaces/trait-isuspensiondriver/)

## Availability

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