pub trait AggregationCacheEx<T: Clone + 'static, K: Eq + Hash + Clone + 'static> {
// Required methods
fn for_aggregation(&self) -> AggregateChangeSets<T>;
fn avg<V: AggregateValue>(
&self,
value_selector: impl Fn(&T) -> V + 'static,
) -> Rc<dyn IObservable<<V::Number as AggregateNumber>::Average>>;
fn avg_with<V: AggregateValue>(
&self,
value_selector: impl Fn(&T) -> V + 'static,
empty_value: V::Number,
) -> Rc<dyn IObservable<<V::Number as AggregateNumber>::Average>>;
fn count_cache(&self) -> Rc<dyn IObservable<usize>>;
fn is_empty_cache(&self) -> Rc<dyn IObservable<bool>>;
fn is_not_empty(&self) -> Rc<dyn IObservable<bool>>;
fn maximum<R: Copy + PartialOrd + Default + 'static>(
&self,
value_selector: impl Fn(&T) -> R + 'static,
) -> Rc<dyn IObservable<R>>;
fn maximum_with<R: Copy + PartialOrd + 'static>(
&self,
value_selector: impl Fn(&T) -> R + 'static,
empty_value: R,
) -> Rc<dyn IObservable<R>>;
fn minimum<R: Copy + PartialOrd + Default + 'static>(
&self,
value_selector: impl Fn(&T) -> R + 'static,
) -> Rc<dyn IObservable<R>>;
fn minimum_with<R: Copy + PartialOrd + 'static>(
&self,
value_selector: impl Fn(&T) -> R + 'static,
empty_value: R,
) -> Rc<dyn IObservable<R>>;
fn std_dev<V: StdDevValue>(
&self,
value_selector: impl Fn(&T) -> V + 'static,
fallback_value: V,
) -> Rc<dyn IObservable<f64>>;
fn sum_cache<V: AggregateValue>(
&self,
value_selector: impl Fn(&T) -> V + 'static,
) -> Rc<dyn IObservable<V::Number>>;
}Expand description
The aggregations of caches (the overloads of AggregationEx, AvgEx, CountEx, MaxEx,
StdDevEx and SumEx on IObservable<IChangeSet<TObject, TKey>>).
Required Methods§
Sourcefn for_aggregation(&self) -> AggregateChangeSets<T>
fn for_aggregation(&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>()).
Sourcefn avg<V: AggregateValue>(
&self,
value_selector: impl Fn(&T) -> V + 'static,
) -> Rc<dyn IObservable<<V::Number as AggregateNumber>::Average>>
fn avg<V: AggregateValue>( &self, value_selector: impl Fn(&T) -> V + 'static, ) -> Rc<dyn IObservable<<V::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>)).
Sourcefn avg_with<V: AggregateValue>(
&self,
value_selector: impl Fn(&T) -> V + 'static,
empty_value: V::Number,
) -> Rc<dyn IObservable<<V::Number as AggregateNumber>::Average>>
fn avg_with<V: AggregateValue>( &self, value_selector: impl Fn(&T) -> V + 'static, empty_value: V::Number, ) -> Rc<dyn IObservable<<V::Number as AggregateNumber>::Average>>
avg with the value when there are no items
(Avg(Func<TObject, TValue>, TValue emptyValue)).
Sourcefn count_cache(&self) -> Rc<dyn IObservable<usize>>
fn count_cache(&self) -> Rc<dyn IObservable<usize>>
The count of the items after each change set (Count<TObject, TKey>(), and
Count<TObject>(IObservable<IDistinctChangeSet<TObject>>)).
Sourcefn is_empty_cache(&self) -> Rc<dyn IObservable<bool>>
fn is_empty_cache(&self) -> Rc<dyn IObservable<bool>>
True at once, then whether there are no items after each change set (IsEmpty).
Sourcefn is_not_empty(&self) -> Rc<dyn IObservable<bool>>
fn is_not_empty(&self) -> Rc<dyn IObservable<bool>>
False at once, then whether there are items after each change set (IsNotEmpty).
Sourcefn maximum<R: Copy + PartialOrd + Default + 'static>(
&self,
value_selector: impl Fn(&T) -> R + 'static,
) -> Rc<dyn IObservable<R>>
fn maximum<R: Copy + PartialOrd + Default + 'static>( &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>)).
Sourcefn maximum_with<R: Copy + PartialOrd + 'static>(
&self,
value_selector: impl Fn(&T) -> R + 'static,
empty_value: R,
) -> Rc<dyn IObservable<R>>
fn maximum_with<R: Copy + PartialOrd + 'static>( &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)).
Sourcefn minimum<R: Copy + PartialOrd + Default + 'static>(
&self,
value_selector: impl Fn(&T) -> R + 'static,
) -> Rc<dyn IObservable<R>>
fn minimum<R: Copy + PartialOrd + Default + 'static>( &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>)).
Sourcefn minimum_with<R: Copy + PartialOrd + 'static>(
&self,
value_selector: impl Fn(&T) -> R + 'static,
empty_value: R,
) -> Rc<dyn IObservable<R>>
fn minimum_with<R: Copy + PartialOrd + 'static>( &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)).
Sourcefn std_dev<V: StdDevValue>(
&self,
value_selector: impl Fn(&T) -> V + 'static,
fallback_value: V,
) -> Rc<dyn IObservable<f64>>
fn std_dev<V: StdDevValue>( &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)).
Sourcefn sum_cache<V: AggregateValue>(
&self,
value_selector: impl Fn(&T) -> V + 'static,
) -> Rc<dyn IObservable<V::Number>>
fn sum_cache<V: AggregateValue>( &self, value_selector: impl Fn(&T) -> V + 'static, ) -> Rc<dyn IObservable<V::Number>>
The sum of the values of the items after each change set (Sum(Func<TObject, TValue>)).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".