# AutoPersistMetadataMixins

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/mixins/trait-autopersistmetadatamixins/

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

```rust
trait AutoPersistMetadataMixins<T: IReactiveObject>
```

AutoPersist with explicit metadata of persistence (the metadata-based extension members of
`IReactiveObject` in `AutoPersistHelperMixins.Metadata`), on the shared handle of an object.

| Upstream | Here |
|---|---|
| `AutoPersist(Func, AutoPersistMetadata)` | `auto_persist_metadata` |
| `AutoPersist(Func, AutoPersistMetadata, TimeSpan?)` | `auto_persist_metadata_with_interval` |
| `AutoPersist<TDontCare>(Func, IObservable<TDontCare>, AutoPersistMetadata, TimeSpan?)`, and without the interval | `auto_persist_metadata_with` |

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/mixins/auto_persist_helper_mixins_metadata.rs#L19)

## Members

- [`auto_persist_metadata`](#function-auto_persist_metadata)
- [`auto_persist_metadata_with_interval`](#function-auto_persist_metadata_with_interval)
- [`auto_persist_metadata_with`](#function-auto_persist_metadata_with)

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

### auto_persist_metadata

```rust
fn auto_persist_metadata(self: &Self, do_persist: impl Fn(Rc<T>) -> Rc<dyn IObservable<()>> + 'static, metadata: Rc<AutoPersistMetadata>) -> Rc<dyn IDisposable>
```

Saves the object after a property of `metadata` changes, with the default interval
(`AutoPersist(Func, AutoPersistMetadata)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/mixins/auto_persist_helper_mixins_metadata.rs#L22)

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

### auto_persist_metadata_with_interval

```rust
fn auto_persist_metadata_with_interval(self: &Self, do_persist: impl Fn(Rc<T>) -> Rc<dyn IObservable<()>> + 'static, metadata: Rc<AutoPersistMetadata>, interval: Option<Duration>) -> Rc<dyn IDisposable>
```

`auto_persist_metadata`, throttled on `interval`
(`AutoPersist(Func, AutoPersistMetadata, TimeSpan?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/mixins/auto_persist_helper_mixins_metadata.rs#L26)

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

### auto_persist_metadata_with

```rust
fn auto_persist_metadata_with<S: 'static>(self: &Self, do_persist: impl Fn(Rc<T>) -> Rc<dyn IObservable<()>> + 'static, manual_save_signal: Rc<dyn IObservable<S>>, metadata: Rc<AutoPersistMetadata>, interval: Option<Duration>) -> Rc<dyn IDisposable>
```

`auto_persist_metadata`, throttled on `interval`, and also
whenever `manual_save_signal` ticks (`AutoPersist<TDontCare>(Func, IObservable<TDontCare>,
AutoPersistMetadata, TimeSpan?)`).

Panics when the metadata is not of a data contract (`ArgumentException`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/mixins/auto_persist_helper_mixins_metadata.rs#L38)

## Trait implementations

- [`AutoPersistMetadataMixins<T>`](/docs/0.5.0/api/ferroui-reactiveui/mixins/trait-autopersistmetadatamixins/)

## Availability

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