ferroui_reactiveui
module · ferroui-reactiveui · v0.5.0
module ferroui_reactiveui
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 macrosreactive_object!andreactive_properties!that write a view model's traits and properties.interfaces: the change notifications (IReactiveNotifyPropertyChanged,ReactivePropertyChangedEventArgs) andIHandleObservableErrors.scheduler:ScheduledSubject.- The root:
RxSchedulers,RxState,RxCacheSizeandUnhandledError.
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 (PanicError).
Contents
interfaces— modulereactive_object— modulescheduler— modulebinding— modulemixins— modulereactive_command— moduleactivation— modulerouting— modulesuspension— modulebuilder— modulechange_sets— modulecomparers— moduleplatform— modulereactive_property— moduleregistration— modulePanicError— structPanicException— type aliasRxCacheSize— structRxSchedulers— structRxState— structUnhandledError— structUnhandledErrorException— type aliasIThreadAffineSequencer— traitRxSuspension— structreactive_object— macroreactive_properties— macrosettable_prop— macroview_for— macroBindingAffinity— structObservableAsPropertyHelper— structObservableAsPropertyInitialValue— enumObservableAsPropertyInheritance— enumBindingChange— structBindingErrors— structTargetInvocationError— structTargetInvocationException— type aliasBindingHooks— structBindingSchedulers— structReactiveBinding— structSequencerViewThreadInvoker— structSettableProperty— structTriggerUpdate— enumViewThreadInvokers— structBindingTypeConverter— traitBindingTypeConverterDispatch— structIBindingFallbackConverter— traitConverterType— structIBindingTypeConverter— traitIBindingTypeConverterOf— traitISetMethodBindingConverter— traitBooleanToStringTypeConverter— structByteToNullableByteTypeConverter— structByteToStringTypeConverter— structDoubleToNullableDoubleTypeConverter— structDoubleToStringTypeConverter— structEqualityTypeConverter— structGuidToStringTypeConverter— structIntegerToNullableIntegerTypeConverter— structIntegerToStringTypeConverter— structLongToNullableLongTypeConverter— structLongToStringTypeConverter— structNullableBooleanToStringTypeConverter— structNullableByteToByteTypeConverter— structNullableByteToStringTypeConverter— structNullableDoubleToDoubleTypeConverter— structNullableDoubleToStringTypeConverter— structNullableGuidToStringTypeConverter— structNullableIntegerToIntegerTypeConverter— structNullableIntegerToStringTypeConverter— structNullableLongToLongTypeConverter— structNullableLongToStringTypeConverter— structNullableShortToShortTypeConverter— structNullableShortToStringTypeConverter— structNullableSingleToSingleTypeConverter— structNullableSingleToStringTypeConverter— structNullableTimeSpanToStringTypeConverter— structShortToNullableShortTypeConverter— structShortToStringTypeConverter— structSingleToNullableSingleTypeConverter— structSingleToStringTypeConverter— structStringConverter— structStringToBooleanTypeConverter— structStringToByteTypeConverter— structStringToDoubleTypeConverter— structStringToGuidTypeConverter— structStringToIntegerTypeConverter— structStringToLongTypeConverter— structStringToNullableBooleanTypeConverter— structStringToNullableByteTypeConverter— structStringToNullableDoubleTypeConverter— structStringToNullableGuidTypeConverter— structStringToNullableIntegerTypeConverter— structStringToNullableLongTypeConverter— structStringToNullableShortTypeConverter— structStringToNullableSingleTypeConverter— structStringToNullableTimeSpanTypeConverter— structStringToShortTypeConverter— structStringToSingleTypeConverter— structStringToTimeSpanTypeConverter— structTimeSpanToStringTypeConverter— structBindingConverters— structBindingFallbackConverterRegistry— structBindingTypeConverterRegistry— structConverterMigrationHelper— structConverterMigrationHelperMixins— traitConverterService— structResolvedConverter— enumConverterTypePair— structregister_default_converters— functionDefaultConverterRegistration— structExtractedConverters— structSetMethodBindingConverterRegistry— structIReactiveUIBindingBuilder— traitIReactiveUIBindingInstance— traitReactiveUIBindingBuilder— structregister_observation_defaults— functionReactiveUIBindingModule— structRxBindingBuilder— structRxBindingBuilderMixins— traitCommandBinderService— structCommandInvoker— structCreatesCommandBindingViaCommandParameter— structbind_command_to_event— functioncontrol_event— functionControlEventSubscription— type aliasCreatesCommandBindingViaEvent— structDEFAULT_COMMAND_EVENTS— constantIInteraction— traitIInteractionContext— traitIOutputContext— traitInteraction— structInteractionHandler— type aliasInteractionContext— structUnhandledInteractionError— structUnhandledInteractionException— type aliasBindingDirection— enumCreatesObservableForPropertyMixins— traitICreatesObservableForProperty— traitIObservedChange— traitObservedChange— structBindingHookChanges— type aliasIPropertyBindingHook— traitIReactiveBinding— traitIViewThreadInvoker— traitIActivatableView— traitCommandEventSubscription— type aliasCommandParameter— type aliasICreatesCommandBinding— traittyped_view_for— functionview_for_of— functionIntoViewFor— traitIViewFor— traitIViewForOf— traitIViewLocator— traitViewModelType— structViewLocatorMixins— traitswitch_latest— functionObservableLeaf— traitObservedProperty— structReactiveUIBindingExtensions— traitInvokeCommandExt— traitToPropertyMixins— traitWhenAnyObservablePaths— traitWhenAnyObservableCombinePaths— traitWhenAnyPaths— traitBindToMixins— traitPropertyBindingMixins— traitSourceBindingMixins— traitBuilderMixins— traitBindCommandMixins— traitCommandValue— traitControlValue— traitToEvent— structBindInteractionMixins— traitInteractionContextOf— type aliasInteractionValue— traitExpressionChainParameters— structValueComparer— type aliasExpressionChainSink— structINPCObservableForProperty— structObservableForPropertySink— structObservedChangedMixins— traitObservedChangedStreamMixins— traitObservedPropertyKey— structPOCOObservableForProperty— structfind_observer_for_property— functionnotify_for_property— functionobservers_for_property— functionReactiveNotifyPropertyChangedMixins— traitCallbackPropertyObservable— structCombineLatestObservable— structCombineLatestSources— traitDeferredPropertyObservable— structNotifyPropertyChangedObservable— structPluginObservationSource— structPluginPropertyObservable— structPropertyChangingObservable— structPropertyObservable— structUnchangingPropertyObservable— structAppliedChangeObservable— structEventObservable— structInitialBindingSignal— structNotificationKind— enumViewThreadObservable— structIHandleObservableErrors— traitIReactiveNotifyPropertyChanged— traitIReactivePropertyChangedEventArgs— traitReactivePropertyChangedEventArgs— structReactivePropertyChangingEventArgs— structIActivatableViewModel— traitICanActivate— traitICanForceManualActivation— traitIMessageBus— traitMessageKey— structIRoutableViewModel— traitIScreen— traitISuspensionDriver— traitISuspensionDriverOf— traitAppStateFactory— type aliasISuspensionHost— traitISuspensionHostOf— traitTypedAppStateFactory— type aliasObservableLoggingMixins— traitAsyncExecution— type aliasObservableMixins— traitSwitchSource— traitSwitchSubscribeMixins— traitAutoPersistChangeSetMixins— traitAutoPersistCollectionMixins— traitAutoPersistHelperMixins— traitDataContract— traitAutoPersistMetadataMixins— traitAutoPersistCollectionMetadataMixins— traitAutoPersistMetadata— structMetadataProvider— type aliasPersistFunction— type aliasCombinedReactiveCommand— structICommand— traitIReactiveCommand— traitIReactiveCommandOf— traitOptionalCanExecute— type aliasOptionalScheduler— type aliasReactiveCommand— structIExtensionState— traitIReactiveObject— traitIReactiveObjectExt— traitIReactiveObjectExtensions— structChangeObservable— type aliasReactiveNotificationHelpers— structReactiveObject— structReactiveRecord— structScheduledSubject— structDefaultViewLocator— structGeneratedViewDispatch— type aliasExcludeFromViewRegistration— structSingleInstanceView— structViewContract— structViewLocator— structViewLocatorNotFoundError— structViewLocatorNotFoundException— type aliasViewMappingBuilder— structRegisterViewForExt— traitViewRegistrationOptions— structViewRegistrations— structActivationSignals— structCanActivateViewFetcher— structIActivationForViewFetcher— traitregister_activatable_view_model— functionActivationDisposables— type aliasViewForMixins— traitViewModelActivationMixins— traitViewModelValue— type aliasViewModelActivator— structIMessageBusExt— traitMessageBus— structNotAWeakReference— structRoutableViewModelMixins— traitNavigateBackCommand— type aliasNavigateCommand— type aliasNavigationStack— type aliasNavigationStackSnapshot— type aliasRoutableViewModel— type aliasRoutingState— structRoutingStateMixins— traitSkipFirstObserver— structDummySuspensionDriver— structSuspensionHost— structSuspensionHostExtensions— traitSuspensionHostOfExtensions— traitSuspensionHostOf— structReactiveUIBuilderMixins— traitReactiveUIInstanceMixins— traitResolveServices— traitIReactiveUIBuilder— traitReactiveUIBuilderExt— traitResolverAction— type aliasIReactiveUIInstance— traitIViewModule— traitReactiveUIBuilder— structRxAppBuilder— structRxAppBuilderMixins— traitChangeSetBinder— structReactiveChangeHandler— type aliasChangeSetExtensions— traitChangeSetSource— traitChangeSetCountMixins— traitChangeSetMixins— traitCollectionChanged— structCollectionChangedExtensions— traitIReactiveChangeSet— traitIReactiveChangeSetOf— traitReactiveChange— structReactiveChangeReason— enumReactiveChangeSet— structChainedComparer— structComparerChainingExtensions— traitIComparerBuilder— traitOrderedComparerTypeWrapper— structOrderedComparer— structComparer— type aliasIReactiveProperty— traitDataErrors— type aliasIntoValidationErrors— traitReactiveProperty— structValidationErrors— enumReactivePropertyMixins— traitSingletonDataErrorsChangedEventArgs— structSingletonPropertyChangedEventArgs— structDependencyResolverRegistrar— structIPlatformOperations— traitIRegistrar— traitRegistrarExt— traitIWantsToRegisterStuff— traitMutableDependencyResolverExtensions— traitPlatformRegistrations— structRegistrations— struct
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.