Skip to main content

SortedObservableCacheEx

Trait SortedObservableCacheEx 

Source
pub trait SortedObservableCacheEx<T: Clone + 'static, K: Eq + Hash + Clone + 'static, C: ISortedChangeSet<T, K>> {
    // Required methods
    fn sorted_source(&self) -> Rc<dyn IObservable<C>>;
    fn sorted_change_sets(&self) -> Rc<dyn IObservable<SortedChangeSet<T, K>>>;

    // Provided methods
    fn as_sorted_aggregator(&self) -> TypedChangeSetAggregator<T, K, C> { ... }
    fn treat_moves_as_remove_add(
        &self,
    ) -> Rc<dyn IObservable<SortedChangeSet<T, K>>> { ... }
    fn update_index(&self) -> Rc<dyn IObservable<C>>
       where T: IIndexAware { ... }
    fn virtualise(
        &self,
        virtual_requests: Rc<dyn IObservable<VirtualRequest>>,
    ) -> Rc<dyn IObservable<VirtualChangeSet<T, K>>> { ... }
    fn top_sorted(
        &self,
        size: usize,
    ) -> Rc<dyn IObservable<VirtualChangeSet<T, K>>> { ... }
    fn page(
        &self,
        page_requests: Rc<dyn IObservable<PageRequest>>,
    ) -> Rc<dyn IObservable<PagedChangeSet<T, K>>> { ... }
}
Expand description

The operators of sorted change sets (ObservableCacheEx over ISortedChangeSet), for every sequence of sorted, paged or virtual change sets C.

Required Methods§

Source

fn sorted_source(&self) -> Rc<dyn IObservable<C>>

The sequence itself.

Source

fn sorted_change_sets(&self) -> Rc<dyn IObservable<SortedChangeSet<T, K>>>

The sequence as plain sorted change sets (the upcast of a paged or virtual change set to ISortedChangeSet<TObject, TKey>).

Provided Methods§

Source

fn as_sorted_aggregator(&self) -> TypedChangeSetAggregator<T, K, C>

Records the change sets, the items and the end of the sequence, for tests (TestEx.AsAggregator of sorted, paged and virtual change sets, which make a SortedChangeSetAggregator, a PagedChangeSetAggregator or a VirtualChangeSetAggregator).

Source

fn treat_moves_as_remove_add( &self, ) -> Rc<dyn IObservable<SortedChangeSet<T, K>>>

The sorted change sets with each move replaced by a removal at the previous index and an addition at the current one (TreatMovesAsRemoveAdd).

Source

fn update_index(&self) -> Rc<dyn IObservable<C>>
where T: IIndexAware,

Sets the index of each sorted item to its position before the change set is forwarded (UpdateIndex).

Deviation (DEVIATIONS.md, DynamicData): the change sets keep their type (sorted, paged or virtual), where upstream’s are typed as sorted change sets.

Source

fn virtualise( &self, virtual_requests: Rc<dyn IObservable<VirtualRequest>>, ) -> Rc<dyn IObservable<VirtualChangeSet<T, K>>>

The window of the sorted items that the latest request of virtual_requests asks for, with the indexes of its changes (Virtualise(IObservable<IVirtualRequest>), obsolete upstream).

Source

fn top_sorted(&self, size: usize) -> Rc<dyn IObservable<VirtualChangeSet<T, K>>>

The first size sorted items (Top(int size) of sorted change sets, obsolete upstream).

Deviation (DEVIATIONS.md, DynamicData): named top_sorted, as top is the operator of every cache, which a sorted stream also has.

§Panics

When size is 0 (ArgumentOutOfRangeException).

Source

fn page( &self, page_requests: Rc<dyn IObservable<PageRequest>>, ) -> Rc<dyn IObservable<PagedChangeSet<T, K>>>

The page of the sorted items that the latest request of page_requests asks for, with the indexes of its changes (Page(IObservable<IPageRequest>), obsolete upstream).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: Clone + 'static, K: Eq + Hash + Clone + 'static, C: ISortedChangeSet<T, K>> SortedObservableCacheEx<T, K, C> for Rc<dyn IObservable<C>>

Implementors§