Skip to main content

Crate ferroui_reactive

Crate ferroui_reactive 

Source
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: Observable and ObservableExt).
  • 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§

AnonymousObserver
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.
ObservableBase
An observable whose subscription is the user’s ObservableCore (ObservableBase<T>).
Observer
The factory of observers (Observer).
ObserverBase
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.
TimeInterval
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>).
NotificationKind
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.
IObserverWithResult
An observer whose handlers return a result (IObserver<TValue, TResult>), which Notification::accept_observer_with_result returns.
ObservableCore
The subscription of an ObservableBase (the abstract member SubscribeCore of ObservableBase<T>).
ObserverCore
The handlers of an ObserverBase (the abstract members OnNextCore, OnErrorCore and OnCompletedCore of ObserverBase<T>).
ObserverExt
The extension methods of Observer on an observer (Observer.Extensions.cs).
ProgressExt
The extension methods of Observer on a progress object (Observer.Extensions.cs).

Type Aliases§

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