pub trait IConnectableCache<T, K> {
// Required methods
fn count_changed(&self) -> Rc<dyn IObservable<usize>>;
fn connect_with(
&self,
predicate: Option<Rc<dyn Fn(&T) -> bool>>,
suppress_empty_change_sets: bool,
) -> Rc<dyn IObservable<ChangeSet<T, K>>>;
fn preview_with(
&self,
predicate: Option<Rc<dyn Fn(&T) -> bool>>,
) -> Rc<dyn IObservable<ChangeSet<T, K>>>;
fn watch(&self, key: K) -> Rc<dyn IObservable<Change<T, K>>>;
// Provided methods
fn connect(&self) -> Rc<dyn IObservable<ChangeSet<T, K>>> { ... }
fn connect_filtered(
&self,
predicate: impl Fn(&T) -> bool + 'static,
) -> Rc<dyn IObservable<ChangeSet<T, K>>>
where Self: Sized { ... }
fn preview(&self) -> Rc<dyn IObservable<ChangeSet<T, K>>> { ... }
}Expand description
A cache that can be observed (IConnectableCache<TObject, TKey>).
Required Methods§
Sourcefn count_changed(&self) -> Rc<dyn IObservable<usize>>
fn count_changed(&self) -> Rc<dyn IObservable<usize>>
The number of items, now and whenever it changes (CountChanged).
Sourcefn connect_with(
&self,
predicate: Option<Rc<dyn Fn(&T) -> bool>>,
suppress_empty_change_sets: bool,
) -> Rc<dyn IObservable<ChangeSet<T, K>>>
fn connect_with( &self, predicate: Option<Rc<dyn Fn(&T) -> bool>>, suppress_empty_change_sets: bool, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>
The items as additions, then the changes, of the items that predicate accepts; empty
change sets are left out unless suppress_empty_change_sets is false (Connect).
Sourcefn preview_with(
&self,
predicate: Option<Rc<dyn Fn(&T) -> bool>>,
) -> Rc<dyn IObservable<ChangeSet<T, K>>>
fn preview_with( &self, predicate: Option<Rc<dyn Fn(&T) -> bool>>, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>
The changes before they are applied, while the items are as they were (Preview).
Sourcefn watch(&self, key: K) -> Rc<dyn IObservable<Change<T, K>>>
fn watch(&self, key: K) -> Rc<dyn IObservable<Change<T, K>>>
The changes of the item of key (Watch).
Provided Methods§
Sourcefn connect(&self) -> Rc<dyn IObservable<ChangeSet<T, K>>>
fn connect(&self) -> Rc<dyn IObservable<ChangeSet<T, K>>>
The items and their changes (Connect()).
Sourcefn connect_filtered(
&self,
predicate: impl Fn(&T) -> bool + 'static,
) -> Rc<dyn IObservable<ChangeSet<T, K>>>where
Self: Sized,
fn connect_filtered(
&self,
predicate: impl Fn(&T) -> bool + 'static,
) -> Rc<dyn IObservable<ChangeSet<T, K>>>where
Self: Sized,
The items that predicate accepts and their changes (Connect(Func<TObject, bool>)).
Sourcefn preview(&self) -> Rc<dyn IObservable<ChangeSet<T, K>>>
fn preview(&self) -> Rc<dyn IObservable<ChangeSet<T, K>>>
The changes before they are applied (Preview()).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".