# ICache

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

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

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

A keyed collection that can be edited (`ICache<TObject, TKey>`).

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

## Members

- [`add_or_update`](#function-add_or_update)
- [`clear`](#function-clear)
- [`clone_changes`](#function-clone_changes)
- [`refresh_all`](#function-refresh_all)
- [`refresh_keys`](#function-refresh_keys)
- [`refresh`](#function-refresh)
- [`remove`](#function-remove)
- [`remove_keys`](#function-remove_keys)

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

### add_or_update

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

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

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

<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_query.rs#L24)

<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<TObject, TKey>)`).

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

<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_query.rs#L28)

<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_query.rs#L30)

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

### refresh

```rust
fn refresh(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_query.rs#L32)

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

### remove

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

Removes the item of `key` (`Remove(TKey)`).

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

<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>)`).

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

## Trait implementations

- [`ICache<T, K>`](/docs/0.5.0/api/ferroui-dynamic-data/cache/trait-icache/)

## Availability

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