pub trait IObservableList<T>: IDisposable {
// Required methods
fn count(&self) -> usize;
fn count_changed(&self) -> Rc<dyn IObservable<usize>>;
fn items(&self) -> Vec<T>;
fn connect_with(
&self,
predicate: Option<Rc<dyn Fn(&T) -> bool>>,
) -> Rc<dyn IObservable<ChangeSet<T>>>;
fn preview_with(
&self,
predicate: Option<Rc<dyn Fn(&T) -> bool>>,
) -> Rc<dyn IObservable<ChangeSet<T>>>;
// Provided methods
fn connect(&self) -> Rc<dyn IObservable<ChangeSet<T>>> { ... }
fn preview(&self) -> Rc<dyn IObservable<ChangeSet<T>>> { ... }
}Expand description
A list that can be observed (IObservableList<T>).
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>>,
) -> Rc<dyn IObservable<ChangeSet<T>>>
fn connect_with( &self, predicate: Option<Rc<dyn Fn(&T) -> bool>>, ) -> Rc<dyn IObservable<ChangeSet<T>>>
The items as one range added, then the changes, of the items that predicate accepts
(Connect).
Sourcefn preview_with(
&self,
predicate: Option<Rc<dyn Fn(&T) -> bool>>,
) -> Rc<dyn IObservable<ChangeSet<T>>>
fn preview_with( &self, predicate: Option<Rc<dyn Fn(&T) -> bool>>, ) -> Rc<dyn IObservable<ChangeSet<T>>>
The changes before they are applied (Preview).
Provided Methods§
Sourcefn connect(&self) -> Rc<dyn IObservable<ChangeSet<T>>>
fn connect(&self) -> Rc<dyn IObservable<ChangeSet<T>>>
The items and their changes (Connect()).
Sourcefn preview(&self) -> Rc<dyn IObservable<ChangeSet<T>>>
fn preview(&self) -> Rc<dyn IObservable<ChangeSet<T>>>
The changes before they are applied (Preview()).
Trait Implementations§
Source§impl<T> PartialEq for dyn IObservableList<T>
Lists compare by identity (reference equality), so that they can be the items of a list.
impl<T> PartialEq for dyn IObservableList<T>
Lists compare by identity (reference equality), so that they can be the items of a list.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".