Skip to main content

IObservableList

Trait IObservableList 

Source
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§

Source

fn count(&self) -> usize

The number of items (Count).

Source

fn count_changed(&self) -> Rc<dyn IObservable<usize>>

The number of items, now and whenever it changes (CountChanged).

Source

fn items(&self) -> Vec<T>

The items (Items).

Source

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).

Source

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§

Source

fn connect(&self) -> Rc<dyn IObservable<ChangeSet<T>>>

The items and their changes (Connect()).

Source

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.

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Clone + PartialEq + 'static> IObservableList<T> for ObservableList<T>

Source§

impl<T: Clone + PartialEq + 'static> IObservableList<T> for SourceList<T>