# SwitchCacheEx

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-dynamic-data/cache/trait-switchcacheex/

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

```rust
trait SwitchCacheEx
```

`Switch` of a sequence of caches or of sequences of change sets.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/ops/switch.rs#L18)

## Members

- [`Item`](#assoc_type-item)
- [`Key`](#assoc_type-key)
- [`switch_cache`](#function-switch_cache)

<a id="assoc_type-item"></a>

### Item

```rust
type Item: Clone + 'static
```

The type of the items.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/ops/switch.rs#L20)

<a id="assoc_type-key"></a>

### Key

```rust
type Key: Eq + std::hash::Hash + Clone + 'static
```

The type of the keys.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/ops/switch.rs#L22)

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

### switch_cache

```rust
fn switch_cache(self: &Self) -> Rc<dyn IObservable<ChangeSet<<Self as >::Item, <Self as >::Key>>>
```

The change sets of the latest source: each new source removes the items of the previous
one, then delivers its own; the result completes when the sequence and the latest source
have completed, and an error of either ends it (`Switch(IObservable<IObservableCache>)`,
`Switch(IObservable<IObservable<IChangeSet>>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/ops/switch.rs#L28)

## Trait implementations

- [`SwitchCacheEx`](/docs/0.5.0/api/ferroui-dynamic-data/cache/trait-switchcacheex/)

## Availability

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