# AutoPersistCollectionMetadataMixins

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

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

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

The persistence of the items of a collection with explicit metadata (the extension members of
`TCollection` in `AutoPersistHelperMixins.Persistence`): each item in the collection is saved
when it changes, and an item removed from it is no longer watched.

The collection is an `ObservableCollection` of shared reactive objects.

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

## Members

- [`auto_persist_collection_metadata`](#function-auto_persist_collection_metadata)
- [`auto_persist_collection_metadata_with_interval`](#function-auto_persist_collection_metadata_with_interval)
- [`auto_persist_collection_metadata_with`](#function-auto_persist_collection_metadata_with)
- [`auto_persist_collection_metadata_provider`](#function-auto_persist_collection_metadata_provider)

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

### auto_persist_collection_metadata

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

Persists each item with `metadata`, with the default interval
(`AutoPersistCollection(Func, AutoPersistMetadata)`).

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

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

### auto_persist_collection_metadata_with_interval

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

Persists each item with `metadata`, throttled on `interval`
(`AutoPersistCollection(Func, AutoPersistMetadata, TimeSpan?)`).

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

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

### auto_persist_collection_metadata_with

```rust
fn auto_persist_collection_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>
```

Persists each item with `metadata`, throttled on `interval`, and whenever
`manual_save_signal` ticks (`AutoPersistCollection<TDontCare>(Func, IObservable<TDontCare>,
AutoPersistMetadata, TimeSpan?)` and the overload without the interval).

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_persistence.rs#L140)

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

### auto_persist_collection_metadata_provider

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

Persists each item with the metadata `metadata_provider` gives for it, throttled on
`interval`, and whenever `manual_save_signal` ticks (`AutoPersistCollection<TDontCare>(Func,
IObservable<TDontCare>, Func<TItem, AutoPersistMetadata>, TimeSpan?)` and the overload
without the interval).

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

## Trait implementations

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

## Availability

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