# ISuspensionDriverOf

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

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

```rust
trait ISuspensionDriverOf<T: 'static>: ISuspensionDriver
```

A driver that loads and saves a state of the type `T` (the overloads of `ISuspensionDriver`
that take a `JsonTypeInfo<T>`), which the typed host
`SuspensionHostOf<T>` uses.

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

## Members

- [`load_state_of`](#function-load_state_of)
- [`save_state_of`](#function-save_state_of)

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

### load_state_of

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

The persisted state, or `None` when there is none (`LoadState<T>(JsonTypeInfo<T>)`).

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

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

### save_state_of

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

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

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

## Trait implementations

- [`ISuspensionDriverOf<T>`](/docs/0.5.0/api/ferroui-reactiveui/interfaces/trait-isuspensiondriverof/)

## Availability

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