Skip to main content

ferroui_dynamic_data/cache/
observable_cache_sequence_ex.rs

1//! The operators of `ObservableCacheEx` that apply to any sequence, not only to sequences of change
2//! sets (`FinallySafe<T>`, `MonitorStatus<T>`).
3
4use ferroui_system::IObservable;
5use std::rc::Rc;
6
7/// The operators of `ObservableCacheEx` on a sequence of any values (`ObservableCacheEx.FinallySafe`,
8/// `ObservableCacheEx.MonitorStatus`).
9///
10/// Their names are not those of operators of `ferroui_reactive::ObservableExt`, nor of the
11/// operators of change sets, so the traits can all be in scope.
12pub trait ObservableCacheSequenceEx<T: 'static> {
13    /// The sequence as the handle the operators take.
14    fn observable_sequence(&self) -> Rc<dyn IObservable<T>>;
15
16    super::ops::finally_safe::finally_safe_methods!();
17    super::ops::monitor_status::monitor_status_methods!();
18}
19
20impl<T: 'static> ObservableCacheSequenceEx<T> for Rc<dyn IObservable<T>> {
21    fn observable_sequence(&self) -> Rc<dyn IObservable<T>> {
22        self.clone()
23    }
24}