Expand description
ferroui-reactive
A port of Rx.NET’s System.Reactive (https://github.com/dotnet/reactive) to Rust: observable
sequences, their operators, the schedulers that decide when work runs, the disposables that end
subscriptions, and subjects. It depends on nothing of the user interface of FerroUI; the
interfaces it implements (IObservable<T>, IObserver<T>, IDisposable) are those of
ferroui-system, which the framework uses too, so the sequences of this crate bind to the
properties of controls as they are.
The modules follow the namespaces of System.Reactive:
concurrency:System.Reactive.Concurrency(schedulers).linq:System.Reactive.Linq(the operators:ObservableandObservableExt).- The root:
Notification<T>,Unit,TimeInterval<T>,Timestamped<T>, the observers (Observer,AnonymousObserver<T>,ObserverBase<T>),ObservableBase<T>.
Everything is single-threaded and reference counted, as the object model of FerroUI is: a
sequence and its subscriptions live on the thread that created them, and the schedulers of the
crate run their work on that thread (docs/porting/reactive.md, section 5.1).
Re-exports§
pub use linq::ConnectableObservableExt;pub use linq::Observable;pub use linq::ObservableExt;pub use linq::TaskObservableExt;
Modules§
- concurrency
System.Reactive.Concurrency: the schedulers, which decide when and where work runs.- disposables
System.Reactive.Disposables: the disposables that subscriptions are made of.- linq
System.Reactive.Linq: the operators of observable sequences.- subjects
System.Reactive.Subjects: subjects, which are observers and observables at once, and connectable observables.
Structs§
- Anonymous
Observer - An observer made of functions (
AnonymousObserver<T>). It ignores everything after a terminal notification. Without a function for errors, an error panics, as upstream rethrows it. - Observable
Base - An observable whose subscription is the user’s
ObservableCore(ObservableBase<T>). - Observer
- The factory of observers (
Observer). - Observer
Base - An observer that enforces the grammar of the notifications on its core (
ObserverBase<T>): values reach the core until a terminal notification; the first terminal notification reaches it, and every notification after it is ignored. Disposing the observer stops it the same way. - Time
Interval - A value with the time since the previous value (
TimeInterval<T>). - Timestamped
- A value with the time it was produced (
Timestamped<T>).
Enums§
- Notification
- A notification of an observable sequence as a value (
Notification<T>). - Notification
Kind - The kind of a notification (
NotificationKind).
Traits§
- IDisposable
- A resource or subscription that is released explicitly.
- IObservable
- A push-based source of values.
- IObserver
- Receives notifications from an
IObservable. - IObserver
With Result - An observer whose handlers return a result (
IObserver<TValue, TResult>), whichNotification::accept_observer_with_resultreturns. - Observable
Core - The subscription of an
ObservableBase(the abstract memberSubscribeCoreofObservableBase<T>). - Observer
Core - The handlers of an
ObserverBase(the abstract membersOnNextCore,OnErrorCoreandOnCompletedCoreofObserverBase<T>). - Observer
Ext - The extension methods of
Observeron an observer (Observer.Extensions.cs). - Progress
Ext - The extension methods of
Observeron a progress object (Observer.Extensions.cs).
Type Aliases§
- Observable
Error - The error type carried by
IObserver::on_error: a shared error, so that it can be delivered to several observers and kept by the operators that replay it. Errors compare by identity where the tests of the reactive libraries compare exceptions. - Unit
- The type of a notification without a value (
System.Reactive.Unit): Rust’s unit type.