Skip to main content

AggregateChangeSetEx

Trait AggregateChangeSetEx 

Source
pub trait AggregateChangeSetEx<T: 'static> {
    // Required methods
    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_aggregate(&self) -> Rc<dyn IObservable<usize>>;
    fn std_dev<V: StdDevValue>(
        &self,
        value_selector: impl Fn(&T) -> V + 'static,
        fallback_value: V,
    ) -> Rc<dyn IObservable<f64>>;
    fn sum_aggregate<V: AggregateValue>(
        &self,
        value_selector: impl Fn(&T) -> V + 'static,
    ) -> Rc<dyn IObservable<V::Number>>;
}
Expand description

The aggregations of aggregate change sets (the overloads of AvgEx, CountEx, StdDevEx and SumEx on IObservable<IAggregateChangeSet<T>>), to which the forms of caches and lists forward.

Required Methods§

Source

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<T, TValue>)).

Source

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<T, TValue>, TValue emptyValue)).

Source

fn count_aggregate(&self) -> Rc<dyn IObservable<usize>>

The count of the items after each change set (Count<TObject>()).

Source

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<T, TValue>, TValue fallbackValue)).

Source

fn sum_aggregate<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<T, TValue>)).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§