# ISourceUpdater

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

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

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

An edit of a cache that knows the keys of its items (`ISourceUpdater<TObject, TKey>`).

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

## Members

- [`add_or_update_items`](#function-add_or_update_items)
- [`add_or_update_items_with`](#function-add_or_update_items_with)
- [`add_or_update`](#function-add_or_update)
- [`add_or_update_with`](#function-add_or_update_with)
- [`load`](#function-load)
- [`lookup_item`](#function-lookup_item)
- [`refresh_items`](#function-refresh_items)
- [`refresh_item`](#function-refresh_item)
- [`remove_items`](#function-remove_items)
- [`remove_item`](#function-remove_item)

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

### add_or_update_items

```rust
fn add_or_update_items(self: &mut Self, items: &mut dyn Iterator<Item = T>)
```

Adds or replaces the items (`AddOrUpdate(IEnumerable<TObject>)`).

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

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

### add_or_update_items_with

```rust
fn add_or_update_items_with(self: &mut Self, items: &mut dyn Iterator<Item = T>, comparer: &dyn Fn(&T, &T) -> bool)
```

Adds or replaces the items, leaving out an item equal to the item of its key
(`AddOrUpdate(IEnumerable<TObject>, IEqualityComparer<TObject>)`).

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

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

### add_or_update

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

Adds or replaces the item (`AddOrUpdate(TObject)`).

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

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

### add_or_update_with

```rust
fn add_or_update_with(self: &mut Self, item: T, comparer: &dyn Fn(&T, &T) -> bool)
```

Adds or replaces the item unless it equals the item of its key
(`AddOrUpdate(TObject, IEqualityComparer<TObject>)`).

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

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

### load

```rust
fn load(self: &mut Self, items: &mut dyn Iterator<Item = T>)
```

Replaces every item with the items (`Load`).

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

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

### lookup_item

```rust
fn lookup_item(self: &Self, item: &T) -> Option<T>
```

The item of the key of `item` (`Lookup(TObject)`).

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

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

### refresh_items

```rust
fn refresh_items(self: &mut Self, items: &mut dyn Iterator<Item = T>)
```

Refreshes the items (`Refresh(IEnumerable<TObject>)`).

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

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

### refresh_item

```rust
fn refresh_item(self: &mut Self, item: &T)
```

Refreshes the item (`Refresh(TObject)`).

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

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

### remove_items

```rust
fn remove_items(self: &mut Self, items: &mut dyn Iterator<Item = T>)
```

Removes the items (`Remove(IEnumerable<TObject>)`).

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

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

### remove_item

```rust
fn remove_item(self: &mut Self, item: &T)
```

Removes the item (`Remove(TObject)`).

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

## Availability

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