# IObservableCache

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

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

```rust
trait IObservableCache<T, K>: IConnectableCache<T, K> + IDisposable
```

A cache that can be observed and read (`IObservableCache<TObject, TKey>`).

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

## Members

- [`count`](#function-count)
- [`items`](#function-items)
- [`keys`](#function-keys)
- [`key_values`](#function-key_values)
- [`lookup`](#function-lookup)

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

### count

```rust
fn count(self: &Self) -> usize
```

The number of items (`Count`).

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

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

### items

```rust
fn items(self: &Self) -> Vec<T>
```

The items (`Items`).

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

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

### keys

```rust
fn keys(self: &Self) -> Vec<K>
```

The keys (`Keys`).

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

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

### key_values

```rust
fn key_values(self: &Self) -> IndexMap<K, T>
```

The keys and items, in the order of enumeration of the cache (`KeyValues`).

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

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

### lookup

```rust
fn lookup(self: &Self, key: &K) -> Option<T>
```

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

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

## Trait implementations

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

## Availability

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