Skip to main content

ObservableChangeSet

Struct ObservableChangeSet 

Source
pub struct ObservableChangeSet;
Expand description

The factories of sequences of change sets (ObservableChangeSet).

Implementations§

Source§

impl ObservableChangeSet

Source

pub fn create_cache<T: Clone + 'static, K: Eq + Hash + Clone + 'static>( subscribe: impl Fn(SourceCache<T, K>) -> Rc<dyn IDisposable> + 'static, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

A sequence of the change sets of a cache that subscribe fills; the disposable it returns is disposed with the subscription (Create<TObject, TKey>(Func<ISourceCache<TObject, TKey>, IDisposable>, Func<TObject, TKey>)).

Source

pub fn try_create_cache<T: Clone + 'static, K: Eq + Hash + Clone + 'static>( subscribe: impl Fn(SourceCache<T, K>) -> Result<Rc<dyn IDisposable>, ObservableError> + 'static, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

create_cache with a function that can fail: its error ends the sequence (the exception that upstream catches and delivers with OnError).

Source

pub fn create_cache_with_action<T: Clone + 'static, K: Eq + Hash + Clone + 'static, A: FnOnce() + 'static>( subscribe: impl Fn(SourceCache<T, K>) -> A + 'static, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

A sequence of the change sets of a cache that subscribe fills; the action it returns runs when the subscription is disposed (Create<TObject, TKey>(Func<ISourceCache<TObject, TKey>, Action>, Func<TObject, TKey>)).

Source

pub fn try_create_cache_with_action<T: Clone + 'static, K: Eq + Hash + Clone + 'static, A: FnOnce() + 'static>( subscribe: impl Fn(SourceCache<T, K>) -> Result<A, ObservableError> + 'static, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

create_cache_with_action with a function that can fail: its error ends the sequence.

Source

pub fn create_cache_async_with_disposable_with_token<T: Clone + 'static, K: Eq + Hash + Clone + 'static, Fut: Future<Output = Result<Rc<dyn IDisposable>, ObservableError>> + 'static>( subscribe: impl Fn(SourceCache<T, K>, CancellationToken) -> Fut + 'static, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

The asynchronous form whose task gives the disposable released with the subscription (Create<TObject, TKey>(Func<ISourceCache<TObject, TKey>, CancellationToken, Task<IDisposable>>, Func<TObject, TKey>)): the change sets are delivered from the start, and an error of the task ends the sequence.

Source

pub fn create_cache_async_with_disposable<T: Clone + 'static, K: Eq + Hash + Clone + 'static, Fut: Future<Output = Result<Rc<dyn IDisposable>, ObservableError>> + 'static>( subscribe: impl Fn(SourceCache<T, K>) -> Fut + 'static, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

create_cache_async_with_disposable_with_token without a token (Create<TObject, TKey>(Func<ISourceCache<TObject, TKey>, Task<IDisposable>>, Func<TObject, TKey>)).

Source

pub fn create_cache_async_with_action_with_token<T: Clone + 'static, K: Eq + Hash + Clone + 'static, A: FnOnce() + 'static, Fut: Future<Output = Result<A, ObservableError>> + 'static>( subscribe: impl Fn(SourceCache<T, K>, CancellationToken) -> Fut + 'static, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

The asynchronous form whose task gives the action run with the release of the subscription (Create<TObject, TKey>(Func<ISourceCache<TObject, TKey>, CancellationToken, Task<Action>>, Func<TObject, TKey>)): disposing the subscription completes the sequence, then runs the action.

Source

pub fn create_cache_async_with_action<T: Clone + 'static, K: Eq + Hash + Clone + 'static, A: FnOnce() + 'static, Fut: Future<Output = Result<A, ObservableError>> + 'static>( subscribe: impl Fn(SourceCache<T, K>) -> Fut + 'static, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

create_cache_async_with_action_with_token without a token (Create<TObject, TKey>(Func<ISourceCache<TObject, TKey>, Task<Action>>, Func<TObject, TKey>)).

Source

pub fn create_cache_async_with_token<T: Clone + 'static, K: Eq + Hash + Clone + 'static, Fut: Future<Output = Result<(), ObservableError>> + 'static>( subscribe: impl Fn(SourceCache<T, K>, CancellationToken) -> Fut + 'static, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

The asynchronous form whose task only fills the cache (Create<TObject, TKey>(Func<ISourceCache<TObject, TKey>, CancellationToken, Task>, Func<TObject, TKey>)): disposing the subscription completes the sequence.

Source

pub fn create_cache_async<T: Clone + 'static, K: Eq + Hash + Clone + 'static, Fut: Future<Output = Result<(), ObservableError>> + 'static>( subscribe: impl Fn(SourceCache<T, K>) -> Fut + 'static, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

create_cache_async_with_token without a token (Create<TObject, TKey>(Func<ISourceCache<TObject, TKey>, Task>, Func<TObject, TKey>)).

Source

pub fn create_list<T: Clone + PartialEq + 'static>( subscribe: impl Fn(SourceList<T>) -> Rc<dyn IDisposable> + 'static, ) -> Rc<dyn IObservable<ChangeSet<T>>>

A sequence of the change sets of a list that subscribe fills; the disposable it returns is disposed with the subscription, after the sequence completes (Create<T>(Func<ISourceList<T>, IDisposable>)).

Source

pub fn try_create_list<T: Clone + PartialEq + 'static>( subscribe: impl Fn(SourceList<T>) -> Result<Rc<dyn IDisposable>, ObservableError> + 'static, ) -> Rc<dyn IObservable<ChangeSet<T>>>

create_list with a function that can fail: its error ends the sequence.

Source

pub fn create_list_with_action<T: Clone + PartialEq + 'static, A: FnOnce() + 'static>( subscribe: impl Fn(SourceList<T>) -> A + 'static, ) -> Rc<dyn IObservable<ChangeSet<T>>>

A sequence of the change sets of a list that subscribe fills; the action it returns runs when the subscription is disposed (Create<T>(Func<ISourceList<T>, Action>)).

Source

pub fn try_create_list_with_action<T: Clone + PartialEq + 'static, A: FnOnce() + 'static>( subscribe: impl Fn(SourceList<T>) -> Result<A, ObservableError> + 'static, ) -> Rc<dyn IObservable<ChangeSet<T>>>

create_list_with_action with a function that can fail: its error ends the sequence.

Source

pub fn create_list_async_with_disposable_with_token<T: Clone + PartialEq + 'static, Fut: Future<Output = Result<Rc<dyn IDisposable>, ObservableError>> + 'static>( subscribe: impl Fn(SourceList<T>, CancellationToken) -> Fut + 'static, ) -> Rc<dyn IObservable<ChangeSet<T>>>

The asynchronous form whose task gives the disposable released with the subscription (Create<T>(Func<ISourceList<T>, CancellationToken, Task<IDisposable>>)).

Source

pub fn create_list_async_with_disposable<T: Clone + PartialEq + 'static, Fut: Future<Output = Result<Rc<dyn IDisposable>, ObservableError>> + 'static>( subscribe: impl Fn(SourceList<T>) -> Fut + 'static, ) -> Rc<dyn IObservable<ChangeSet<T>>>

create_list_async_with_disposable_with_token without a token (Create<T>(Func<ISourceList<T>, Task<IDisposable>>)).

Source

pub fn create_list_async_with_action_with_token<T: Clone + PartialEq + 'static, A: FnOnce() + 'static, Fut: Future<Output = Result<A, ObservableError>> + 'static>( subscribe: impl Fn(SourceList<T>, CancellationToken) -> Fut + 'static, ) -> Rc<dyn IObservable<ChangeSet<T>>>

The asynchronous form whose task gives the action run with the release of the subscription (Create<T>(Func<ISourceList<T>, CancellationToken, Task<Action>>)).

Source

pub fn create_list_async_with_action<T: Clone + PartialEq + 'static, A: FnOnce() + 'static, Fut: Future<Output = Result<A, ObservableError>> + 'static>( subscribe: impl Fn(SourceList<T>) -> Fut + 'static, ) -> Rc<dyn IObservable<ChangeSet<T>>>

create_list_async_with_action_with_token without a token (Create<T>(Func<ISourceList<T>, Task<Action>>)).

Source

pub fn create_list_async<T: Clone + PartialEq + 'static, Fut: Future<Output = Result<(), ObservableError>> + 'static>( subscribe: impl Fn(SourceList<T>) -> Fut + 'static, ) -> Rc<dyn IObservable<ChangeSet<T>>>

The asynchronous form whose task only fills the list (Create<T>(Func<ISourceList<T>, Task>)): disposing the subscription completes the sequence.

Source

pub fn create_list_async_with_token<T: Clone + PartialEq + 'static, Fut: Future<Output = Result<(), ObservableError>> + 'static>( subscribe: impl Fn(SourceList<T>, CancellationToken) -> Fut + 'static, ) -> Rc<dyn IObservable<ChangeSet<T>>>

The asynchronous form whose task only fills the list, with a token (Create<T>(Func<ISourceList<T>, CancellationToken, Task>)): unlike the other forms, the change sets are delivered once the task has ended, as upstream subscribes to the list after awaiting it.

Auto Trait Implementations§

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