# AggregationCacheEx

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

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

```rust
trait AggregationCacheEx<T: Clone + 'static, K: Eq + Hash + Clone + 'static>
```

The aggregations of caches (the overloads of `AggregationEx`, `AvgEx`, `CountEx`, `MaxEx`,
`StdDevEx` and `SumEx` on `IObservable<IChangeSet<TObject, TKey>>`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L55)

## Members

- [`for_aggregation`](#function-for_aggregation)
- [`avg`](#function-avg)
- [`avg_with`](#function-avg_with)
- [`count_cache`](#function-count_cache)
- [`is_empty_cache`](#function-is_empty_cache)
- [`is_not_empty`](#function-is_not_empty)
- [`maximum`](#function-maximum)
- [`maximum_with`](#function-maximum_with)
- [`minimum`](#function-minimum)
- [`minimum_with`](#function-minimum_with)
- [`std_dev`](#function-std_dev)
- [`sum_cache`](#function-sum_cache)

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

### for_aggregation

```rust
fn for_aggregation(self: &Self) -> AggregateChangeSets<T>
```

The change sets as aggregate change sets: an add, a remove, or an update as the remove of
the previous item and the add of the current one; refreshes and moves are left out
(`ForAggregation<TObject, TKey>()`).

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

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

### avg

```rust
fn avg<V: AggregateValue>(self: &Self, value_selector: impl Fn(&T) -> V + 'static) -> Rc<dyn IObservable<<<V as >::Number as AggregateNumber>::Average>>
```

The average of the values of the items after each change set, zero when there are none
(`Avg(Func<TObject, TValue>)`).

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

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

### avg_with

```rust
fn avg_with<V: AggregateValue>(self: &Self, value_selector: impl Fn(&T) -> V + 'static, empty_value: <V as >::Number) -> Rc<dyn IObservable<<<V as >::Number as AggregateNumber>::Average>>
```

`avg` with the value when there are no items
(`Avg(Func<TObject, TValue>, TValue emptyValue)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L67)

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

### count_cache

```rust
fn count_cache(self: &Self) -> Rc<dyn IObservable<usize>>
```

The count of the items after each change set (`Count<TObject, TKey>()`, and
`Count<TObject>(IObservable<IDistinctChangeSet<TObject>>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L71)

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

### is_empty_cache

```rust
fn is_empty_cache(self: &Self) -> Rc<dyn IObservable<bool>>
```

True at once, then whether there are no items after each change set (`IsEmpty`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L74)

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

### is_not_empty

```rust
fn is_not_empty(self: &Self) -> Rc<dyn IObservable<bool>>
```

False at once, then whether there are items after each change set (`IsNotEmpty`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L77)

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

### maximum

```rust
fn maximum<R: Copy + PartialOrd + Default + 'static>(self: &Self, value_selector: impl Fn(&T) -> R + 'static) -> Rc<dyn IObservable<R>>
```

The greatest value of the items, `R::default()` when there are none, each time it changes
(`Maximum(Func<TObject, TResult>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L81)

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

### maximum_with

```rust
fn maximum_with<R: Copy + PartialOrd + 'static>(self: &Self, value_selector: impl Fn(&T) -> R + 'static, empty_value: R) -> Rc<dyn IObservable<R>>
```

`maximum` with the value when there are no items
(`Maximum(Func<TObject, TResult>, TResult emptyValue)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L85)

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

### minimum

```rust
fn minimum<R: Copy + PartialOrd + Default + 'static>(self: &Self, value_selector: impl Fn(&T) -> R + 'static) -> Rc<dyn IObservable<R>>
```

The least value of the items, `R::default()` when there are none, each time it changes
(`Minimum(Func<TObject, TResult>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L89)

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

### minimum_with

```rust
fn minimum_with<R: Copy + PartialOrd + 'static>(self: &Self, value_selector: impl Fn(&T) -> R + 'static, empty_value: R) -> Rc<dyn IObservable<R>>
```

`minimum` with the value when there are no items
(`Minimum(Func<TObject, TResult>, TResult emptyValue)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L93)

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

### std_dev

```rust
fn std_dev<V: StdDevValue>(self: &Self, value_selector: impl Fn(&T) -> V + 'static, fallback_value: V) -> Rc<dyn IObservable<f64>>
```

The sample standard deviation of the values of the items after each change set,
`fallback_value` for fewer than two items (`StdDev(Func<TObject, TValue>, TValue
fallbackValue)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L98)

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

### sum_cache

```rust
fn sum_cache<V: AggregateValue>(self: &Self, value_selector: impl Fn(&T) -> V + 'static) -> Rc<dyn IObservable<<V as >::Number>>
```

The sum of the values of the items after each change set (`Sum(Func<TObject, TValue>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/aggregation/aggregation_ex.rs#L101)

## Trait implementations

- [`AggregationCacheEx<T, K>`](/docs/0.5.0/api/ferroui-dynamic-data/aggregation/trait-aggregationcacheex/)

## Availability

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