ferroui-dynamic-data 0.3.0

A port of DynamicData for FerroUI: reactive collections, change sets, observable caches and lists with their operators, independent of the user interface
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! `DistinctValues` (`Cache/ObservableCacheEx.DistinctValues.cs`).

macro_rules! distinct_values_methods {
    () => {
        /// The distinct values that `value_selector` gives for the items, as the changes of a cache
        /// keyed by the values (`DistinctValues(Func<TObject, TValue>)`).
        fn distinct_values<V: Eq + std::hash::Hash + Clone + 'static>(
            &self,
            value_selector: impl Fn(&T) -> V + 'static,
        ) -> std::rc::Rc<dyn ferroui_system::IObservable<crate::cache::DistinctChangeSet<V>>> {
            crate::cache::internal::distinct_calculator(self.change_sets(), std::rc::Rc::new(value_selector))
        }
    };
}
pub(crate) use distinct_values_methods;