1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//! ferroui-reactiveui
//!
//! A port of ReactiveUI (<https://github.com/reactiveui/ReactiveUI>) to Rust, in the flavour that
//! runs on System.Reactive (here `ferroui-reactive`), together with the run time of
//! ReactiveUI.Binding: reactive objects, commands, the observation of properties and the bindings
//! of view models and views for MVVM. It depends on nothing of the user interface of FerroUI; the
//! integration with the framework (the scheduler of the dispatcher, the observation of the
//! properties of controls, the views) builds on it.
//!
//! The modules follow the folders of ReactiveUI.Core and ReactiveUI.Shared, in snake case, and the
//! run time of ReactiveUI.Binding is under `binding`. Everything public is re-exported at the
//! root, as upstream puts it in the namespaces `ReactiveUI` and `ReactiveUI.Binding`:
//!
//! - [`reactive_object`]: [`ReactiveObject`], the part of a view model that notifies the changes
//! of its properties ([`IReactiveObject`], [`IReactiveObjectExt`]), [`ReactiveRecord`], and the
//! macros [`reactive_object!`] and [`reactive_properties!`] that write a view model's traits and
//! properties.
//! - [`interfaces`]: the change notifications ([`IReactiveNotifyPropertyChanged`],
//! [`ReactivePropertyChangedEventArgs`]) and [`IHandleObservableErrors`].
//! - [`scheduler`]: [`ScheduledSubject`].
//! - The root: [`RxSchedulers`], [`RxState`], [`RxCacheSize`] and [`UnhandledErrorException`].
//!
//! A view model holds a [`ReactiveObject`] and is shared as an `Rc`:
//!
//! ```
//! use ferroui_reactiveui::{reactive_object, reactive_properties, IReactiveNotifyPropertyChanged, ReactiveObject};
//! use ferroui_reactive::ObservableExt;
//! use std::cell::Cell;
//! use std::rc::Rc;
//!
//! reactive_properties! {
//! #[derive(Default)]
//! pub struct Counter {
//! reactive: ReactiveObject,
//! #[reactive]
//! count: i32,
//! }
//! }
//! reactive_object!(Counter);
//!
//! let counter = Rc::new(Counter::default());
//! let changes = Rc::new(Cell::new(0));
//! let seen = changes.clone();
//! let _subscription = counter.changed().subscribe_next(move |_| seen.set(seen.get() + 1));
//! counter.set_count(1);
//! counter.set_count(1);
//! assert_eq!(changes.get(), 1);
//! ```
//!
//! Everything is single-threaded and reference counted, as the object model of FerroUI is
//! (`docs/porting/reactive.md`, section 5.1). An exception of user code is a panic; where upstream
//! catches one, the port catches the panic ([`PanicException`]).
pub
pub
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use PanicException;
pub use *;
pub use RxCacheSize;
pub use RxSchedulers;
pub use RxState;
pub use *;
pub use UnhandledErrorException;
/// What the macros of the crate expand to, so that a crate that uses them needs no other
/// dependency.
pub use IThreadAffineSequencer;
pub use *;
pub use *;
pub use *;
pub use *;
pub use RxSuspension;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;