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
//! `Cast` (`Cache/ObservableCacheEx.Cast.cs`).

macro_rules! cast_methods {
    () => {
        /// The change sets with each item converted by `converter`
        /// (`Cast(Func<TSource, TDestination>)`; named `cast_cache` beside `ObservableExt::cast`).
        fn cast_cache<U: Clone + 'static>(&self, converter: impl Fn(&T) -> U + 'static) -> std::rc::Rc<dyn ferroui_system::IObservable<crate::cache::ChangeSet<U, K>>> {
            crate::cache::internal::cast(self.change_sets(), std::rc::Rc::new(converter))
        }
    };
}
pub(crate) use cast_methods;