# ICacheUpdater

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

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

```rust
trait ICacheUpdater<T, K>: IQuery<T, K>
```

An edit of a cache whose items carry their keys (`ICacheUpdater<TObject, TKey>`).

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

## Members

- [`add_or_update_pairs`](#function-add_or_update_pairs)
- [`add_or_update_with_key`](#function-add_or_update_with_key)
- [`clear`](#function-clear)
- [`clone_changes`](#function-clone_changes)
- [`get_key`](#function-get_key)
- [`get_key_values`](#function-get_key_values)
- [`refresh_all`](#function-refresh_all)
- [`refresh_keys`](#function-refresh_keys)
- [`refresh_key`](#function-refresh_key)
- [`remove_keys`](#function-remove_keys)
- [`remove_key`](#function-remove_key)
- [`remove_pairs`](#function-remove_pairs)

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

### add_or_update_pairs

```rust
fn add_or_update_pairs(self: &mut Self, pairs: &mut dyn Iterator<Item = (K, T)>)
```

Adds or replaces the items of the keys (`AddOrUpdate(IEnumerable<KeyValuePair>)`).

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

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

### add_or_update_with_key

```rust
fn add_or_update_with_key(self: &mut Self, item: T, key: K)
```

Adds or replaces the item of `key` (`AddOrUpdate(TObject, TKey)`,
`AddOrUpdate(KeyValuePair)`).

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

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

### clear

```rust
fn clear(self: &mut Self)
```

Removes every item (`Clear`).

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

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

### clone_changes

```rust
fn clone_changes(self: &mut Self, changes: &ChangeSet<T, K>)
```

Applies a change set (`Clone(IChangeSet)`, `Update(IChangeSet)`).

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

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

### get_key

```rust
fn get_key(self: &Self, item: &T) -> K
```

The key of `item` (`GetKey`).
## Panics
When the cache has no key selector (`KeySelectorException`).

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

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

### get_key_values

```rust
fn get_key_values(self: &Self, items: &mut dyn Iterator<Item = T>) -> Vec<(K, T)>
```

The keys of the items, with the items (`GetKeyValues`).

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

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

### refresh_all

```rust
fn refresh_all(self: &mut Self)
```

Refreshes every item (`Refresh()`).

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

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

### refresh_keys

```rust
fn refresh_keys(self: &mut Self, keys: &mut dyn Iterator<Item = K>)
```

Refreshes the items of the keys (`Refresh(IEnumerable<TKey>)`).

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

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

### refresh_key

```rust
fn refresh_key(self: &mut Self, key: &K)
```

Refreshes the item of `key` (`Refresh(TKey)`).

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

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

### remove_keys

```rust
fn remove_keys(self: &mut Self, keys: &mut dyn Iterator<Item = K>)
```

Removes the items of the keys (`Remove(IEnumerable<TKey>)`, `RemoveKeys`).

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

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

### remove_key

```rust
fn remove_key(self: &mut Self, key: &K)
```

Removes the item of `key` (`Remove(TKey)`, `RemoveKey`, `Remove(KeyValuePair)`).

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

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

### remove_pairs

```rust
fn remove_pairs(self: &mut Self, pairs: &mut dyn Iterator<Item = (K, T)>)
```

Removes the items of the pairs' keys (`Remove(IEnumerable<KeyValuePair>)`).

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

## Availability

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