Skip to main content

ObservableList

Struct ObservableList 

Source
pub struct ObservableList<T> { /* private fields */ }
Expand description

A read-only list of the items of a sequence of change sets (AnonymousObservableList<T>, the result of AsObservableList).

Implementations§

Source§

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

Source

pub fn from_source<C: IChangeSet<T>>(source: Rc<dyn IObservable<C>>) -> Self

The list of the items of source (AnonymousObservableList(IObservable<IChangeSet<T>>)).

Source

pub fn from_list(list: &SourceList<T>) -> Self

A read-only view of list (AnonymousObservableList(ISourceList<T>)).

Trait Implementations§

Source§

impl<S: CacheChangeSetSource + Clone + PartialEq> CacheSourceListCombineEx for ObservableList<S>

Source§

type Item = <S as CacheChangeSetSource>::Item

The type of the items.
Source§

type Key = <S as CacheChangeSetSource>::Key

The type of the keys.
Source§

fn and_cache(&self) -> Rc<dyn IObservable<ChangeSet<S::Item, S::Key>>>
where Self::Item: Deref,

The items that are in every source of the list; none while the list is empty (And(IObservableList<..>)).
Source§

fn or(&self) -> Rc<dyn IObservable<ChangeSet<S::Item, S::Key>>>
where Self::Item: Deref,

The items that are in any source of the list (Or(IObservableList<..>)).
Source§

fn xor(&self) -> Rc<dyn IObservable<ChangeSet<S::Item, S::Key>>>
where Self::Item: Deref,

The items that are in exactly one source of the list (Xor(IObservableList<..>)).
Source§

fn except(&self) -> Rc<dyn IObservable<ChangeSet<S::Item, S::Key>>>
where Self::Item: Deref,

The items of the first source of the list that are in none of the others (Except(IObservableList<..>)).
Source§

impl<T> Clone for ObservableList<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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

Source§

fn dispose(&self)

Source§

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

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).
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()).
Source§

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

Source§

type Item = T

The type of the items.
Source§

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

The change sets of the source: the sequence itself, or Connect() of a list.
Source§

impl<S: ListChangeSetSource + Clone + PartialEq> ListSourceListCombineEx for ObservableList<S>

Source§

type Item = <S as ListChangeSetSource>::Item

The type of the items.
Source§

fn and_list(&self) -> Rc<dyn IObservable<ChangeSet<S::Item>>>
where Self::Item: Eq + Hash,

The items that are in every source of the list; none while the list is empty (And(IObservableList<..>)).
Source§

fn or(&self) -> Rc<dyn IObservable<ChangeSet<S::Item>>>
where Self::Item: Eq + Hash,

The items that are in any source of the list (Or(IObservableList<..>)).
Source§

fn xor(&self) -> Rc<dyn IObservable<ChangeSet<S::Item>>>
where Self::Item: Eq + Hash,

The items that are in exactly one source of the list (Xor(IObservableList<..>)).
Source§

fn except(&self) -> Rc<dyn IObservable<ChangeSet<S::Item>>>
where Self::Item: Eq + Hash,

The items of the first source of the list that are in none of the others (Except(IObservableList<..>)).

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for ObservableList<T>

§

impl<T> !Send for ObservableList<T>

§

impl<T> !Sync for ObservableList<T>

§

impl<T> !UnwindSafe for ObservableList<T>

§

impl<T> Freeze for ObservableList<T>
where SourceList<T>: Freeze,

§

impl<T> Unpin for ObservableList<T>
where SourceList<T>: Unpin,

§

impl<T> UnsafeUnpin for ObservableList<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, L> SourceListEx<T> for L
where T: Clone + PartialEq + 'static, L: IObservableList<T> + ?Sized,

Source§

fn cast_list<U: Clone + 'static>( &self, conversion_factory: impl Fn(&T) -> U + 'static, ) -> Rc<dyn IObservable<ChangeSet<U>>>
where Self: ISourceList<T>,

The items and their changes, each item converted by conversion_factory (Cast(ISourceList<TSource>, Func<TSource, TDestination>)).
Source§

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

The items and their changes from the first change set (DeferUntilLoaded(IObservableList)).
Source§

fn expire_after( &self, time_selector: impl Fn(&T) -> Option<Duration> + 'static, ) -> Rc<dyn IObservable<Vec<T>>>
where Self: ISourceList<T> + Clone + Sized + 'static,

Removes each item from the list once the time that time_selector gives for it has passed (None: never), timed on the default scheduler; the removed items (ExpireAfter(ISourceList, Func<T, TimeSpan?>, TimeSpan? = null, IScheduler? = null)).
Source§

fn expire_after_on( &self, time_selector: impl Fn(&T) -> Option<Duration> + 'static, scheduler: Rc<dyn IScheduler>, ) -> Rc<dyn IObservable<Vec<T>>>
where Self: ISourceList<T> + Clone + Sized + 'static,

expire_after on scheduler.
Source§

fn expire_after_with_polling( &self, time_selector: impl Fn(&T) -> Option<Duration> + 'static, polling_interval: Option<Duration>, ) -> Rc<dyn IObservable<Vec<T>>>
where Self: ISourceList<T> + Clone + Sized + 'static,

expire_after that removes the expired items every polling_interval rather than at their times.
Source§

fn expire_after_with_polling_on( &self, time_selector: impl Fn(&T) -> Option<Duration> + 'static, polling_interval: Option<Duration>, scheduler: Rc<dyn IScheduler>, ) -> Rc<dyn IObservable<Vec<T>>>
where Self: ISourceList<T> + Clone + Sized + 'static,

Source§

fn limit_size_to(&self, size_limit: usize) -> Rc<dyn IObservable<Vec<T>>>
where Self: ISourceList<T> + Clone + Sized + 'static,

Removes the oldest items of the list beyond size_limit, on the default scheduler; the removed items (LimitSizeTo(ISourceList, int, IScheduler? = null)). Read more
Source§

fn limit_size_to_on( &self, size_limit: usize, scheduler: Rc<dyn IScheduler>, ) -> Rc<dyn IObservable<Vec<T>>>
where Self: ISourceList<T> + Clone + Sized + 'static,

limit_size_to on scheduler.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.