# SortedObservableCacheEx

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

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

```rust
trait SortedObservableCacheEx<T: Clone + 'static, K: Eq + Hash + Clone + 'static, C: ISortedChangeSet<T, K>>
```

The operators of sorted change sets (`ObservableCacheEx` over `ISortedChangeSet`), for every
sequence of sorted, paged or virtual change sets `C`.

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

## Members

- [`sorted_source`](#function-sorted_source)
- [`sorted_change_sets`](#function-sorted_change_sets)
- [`treat_moves_as_remove_add`](#function-treat_moves_as_remove_add)
- [`update_index`](#function-update_index)
- [`virtualise`](#function-virtualise)
- [`top_sorted`](#function-top_sorted)
- [`page`](#function-page)

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

### sorted_source

```rust
fn sorted_source(self: &Self) -> Rc<dyn IObservable<C>>
```

The sequence itself.

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

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

### sorted_change_sets

```rust
fn sorted_change_sets(self: &Self) -> Rc<dyn IObservable<SortedChangeSet<T, K>>>
```

The sequence as plain sorted change sets (the upcast of a paged or virtual change set to
`ISortedChangeSet<TObject, TKey>`).

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

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

### treat_moves_as_remove_add

```rust
fn treat_moves_as_remove_add(self: &Self) -> std::rc::Rc<dyn ferroui_system::IObservable<crate::cache::SortedChangeSet<T, K>>>
```

The sorted change sets with each move replaced by a removal at the previous index and an
addition at the current one (`TreatMovesAsRemoveAdd`).

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

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

### update_index

```rust
fn update_index(self: &Self) -> std::rc::Rc<dyn ferroui_system::IObservable<C>>
where T: crate::binding::IIndexAware
```

Sets the index of each sorted item to its position before the change set is forwarded
(`UpdateIndex`).

Deviation (DEVIATIONS.md, DynamicData): the change sets keep their type (sorted, paged
or virtual), where upstream's are typed as sorted change sets.

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

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

### virtualise

```rust
fn virtualise(self: &Self, virtual_requests: std::rc::Rc<dyn ferroui_system::IObservable<crate::cache::VirtualRequest>>) -> std::rc::Rc<dyn ferroui_system::IObservable<crate::cache::VirtualChangeSet<T, K>>>
```

The window of the sorted items that the latest request of `virtual_requests` asks
for, with the indexes of its changes (`Virtualise(IObservable<IVirtualRequest>)`,
obsolete upstream).

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

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

### top_sorted

```rust
fn top_sorted(self: &Self, size: usize) -> std::rc::Rc<dyn ferroui_system::IObservable<crate::cache::VirtualChangeSet<T, K>>>
```

The first `size` sorted items (`Top(int size)` of sorted change sets, obsolete
upstream).

Deviation (DEVIATIONS.md, DynamicData): named `top_sorted`, as `top` is the operator of
every cache, which a sorted stream also has.
## Panics
When `size` is 0 (`ArgumentOutOfRangeException`).

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

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

### page

```rust
fn page(self: &Self, page_requests: std::rc::Rc<dyn ferroui_system::IObservable<crate::cache::PageRequest>>) -> std::rc::Rc<dyn ferroui_system::IObservable<crate::cache::PagedChangeSet<T, K>>>
```

The page of the sorted items that the latest request of `page_requests` asks for, with
the indexes of its changes (`Page(IObservable<IPageRequest>)`, obsolete upstream).

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

## Trait implementations

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

## Availability

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