IReactiveUIBuilder
trait · ferroui-reactiveui · v0.5.0
trait IReactiveUIBuilder: IAppBuilder
The builder of a ReactiveUI application (IReactiveUIBuilder): the services, schedulers and
state of ReactiveUI, configured by chained calls, then built once.
Deviation (DEVIATIONS.md, ReactiveUI): a trait object cannot have generic methods, so this
trait has the methods of upstream's interface that are not generic, each returning the builder
as a trait object; the generic ones (RegisterView<TView, TViewModel>, WithPlatformModule<T>,
WithSuspensionHost<TAppState>, WithConverter<TFrom, TTo>) are those of
ReactiveUIBuilderExt, which every builder has, and WithInstance is
ReactiveUIInstanceMixins::with_instance of
the built application. Upstream's overloads have their own names: the forms with a flag that
says whether to set RxSchedulers end in _with, and the forms that take a factory end in
_factory. The concrete ReactiveUIBuilder has the same methods,
returning itself, so that a chain of calls on it keeps every method at hand.
Members
with_message_buswith_message_bus_withwith_message_bus_instanceconfigure_suspension_driverconfigure_view_locatorfor_custom_platformfor_platformswith_main_thread_schedulerwith_main_thread_scheduler_withwith_platform_serviceswith_registrationwith_registrationswith_registration_on_buildwith_task_pool_schedulerwith_task_pool_scheduler_withwith_exception_handlerwith_suspension_hostwith_suspension_host_instancewith_cache_sizeswith_converterwith_converter_factorywith_fallback_converterwith_fallback_converter_factorywith_set_method_converterwith_set_method_converter_factorywith_converters_fromusing_splat_moduleusing_splat_builderbuild_app
with_message_bus
fn with_message_bus(self: &Self) -> &dyn IReactiveUIBuilder
Registers a new message bus when the application is built (WithMessageBus()).
with_message_bus_with
fn with_message_bus_with(self: &Self, configure: Rc<dyn Fn(&dyn IMessageBus) -> ()>) -> &dyn IReactiveUIBuilder
Registers a new message bus, configured by configure, when the application is built
(WithMessageBus(Action<IMessageBus>)).
with_message_bus_instance
fn with_message_bus_instance(self: &Self, message_bus: Rc<dyn IMessageBus>) -> &dyn IReactiveUIBuilder
Registers message_bus when the application is built (WithMessageBus(IMessageBus)).
configure_suspension_driver
fn configure_suspension_driver(self: &Self, configure: Rc<dyn Fn(&Rc<dyn ISuspensionDriver>) -> ()>) -> &dyn IReactiveUIBuilder
Configures the registered suspension driver, if there is one, when the application is built
(ConfigureSuspensionDriver(Action<ISuspensionDriver>)).
configure_view_locator
fn configure_view_locator(self: &Self, configure: Rc<dyn Fn(&DefaultViewLocator) -> ()>) -> &dyn IReactiveUIBuilder
Configures the registered DefaultViewLocator when the application is built, keeping its
mappings; with none registered, a new one is configured and registered as the view locator
(ConfigureViewLocator(Action<DefaultViewLocator>)).
for_custom_platform
fn for_custom_platform(self: &Self, main_thread_scheduler: Rc<dyn IScheduler>, platform_services: ResolverAction) -> &dyn IReactiveUIBuilder
Configures a platform of the application's own: its main thread scheduler, and its
services, registered when the application is built
(ForCustomPlatform(ISequencer, Action<IMutableDependencyResolver>)).
for_platforms
fn for_platforms(self: &Self, platform_configurations: &[&dyn Fn(&dyn IReactiveUIBuilder) -> ()]) -> &dyn IReactiveUIBuilder
Applies the configuration of each platform (ForPlatforms(params Action<IReactiveUIBuilder>[])).
with_main_thread_scheduler
fn with_main_thread_scheduler(self: &Self, scheduler: Rc<dyn IScheduler>) -> &dyn IReactiveUIBuilder
Sets the scheduler of the user-interface thread, which also becomes
RxSchedulers::main_thread_scheduler when the application is built
(WithMainThreadScheduler(ISequencer)).
with_main_thread_scheduler_with
fn with_main_thread_scheduler_with(self: &Self, scheduler: Rc<dyn IScheduler>, set_rx_app: bool) -> &dyn IReactiveUIBuilder
Sets the scheduler of the user-interface thread; set_rx_app says whether it becomes
RxSchedulers::main_thread_scheduler (WithMainThreadScheduler(ISequencer, bool)).
with_platform_services
fn with_platform_services(self: &Self) -> &dyn IReactiveUIBuilder
Registers the services of the platform, once (WithPlatformServices).
with_registration
fn with_registration(self: &Self, configure_action: &dyn Fn(&dyn IMutableDependencyResolver) -> ()) -> &dyn IReactiveUIBuilder
Applies configure_action to the resolver at once (WithRegistration(Action<IMutableDependencyResolver>)).
with_registrations
fn with_registrations(self: &Self, registration: &dyn IWantsToRegisterStuff) -> &dyn IReactiveUIBuilder
Applies registration to the resolver at once, through a DependencyResolverRegistrar
(WithRegistration(IWantsToRegisterStuff)).
with_registration_on_build
fn with_registration_on_build(self: &Self, configure_action: ResolverAction) -> &dyn IReactiveUIBuilder
Applies configure_action to the resolver when the application is built
(WithRegistrationOnBuild(Action<IMutableDependencyResolver>)).
with_task_pool_scheduler
fn with_task_pool_scheduler(self: &Self, scheduler: Rc<dyn IScheduler>) -> &dyn IReactiveUIBuilder
Sets the scheduler of background work, which also becomes
RxSchedulers::task_pool_scheduler when the application is built
(WithTaskPoolScheduler(ISequencer)).
with_task_pool_scheduler_with
fn with_task_pool_scheduler_with(self: &Self, scheduler: Rc<dyn IScheduler>, set_rx_app: bool) -> &dyn IReactiveUIBuilder
Sets the scheduler of background work; set_rx_app says whether it becomes
RxSchedulers::task_pool_scheduler (WithTaskPoolScheduler(ISequencer, bool)).
with_exception_handler
fn with_exception_handler(self: &Self, exception_handler: Rc<dyn IObserver<ObservableError>>) -> &dyn IReactiveUIBuilder
Sets the handler of the errors that no thrown_exceptions subscriber handles
(WithExceptionHandler(IObserver<Exception>)).
with_suspension_host
fn with_suspension_host(self: &Self) -> &dyn IReactiveUIBuilder
Sets a suspension host, which becomes the one of RxSuspension when the application is
built (WithSuspensionHost()).
with_suspension_host_instance
fn with_suspension_host_instance(self: &Self, suspension_host: Rc<dyn ISuspensionHost>) -> &dyn IReactiveUIBuilder
Sets suspension_host as the suspension host: the form of WithSuspensionHost<TAppState>()
that a trait object can have, which ReactiveUIBuilderExt::with_suspension_host_of calls.
with_cache_sizes
fn with_cache_sizes(self: &Self, small_cache_limit: usize, big_cache_limit: usize) -> &dyn IReactiveUIBuilder
Sets the limits of the caches of ReactiveUI (WithCacheSizes(int, int)).
Panics
When a limit is zero (ArgumentOutOfRangeException).
with_converter
fn with_converter(self: &Self, converter: Rc<dyn IBindingTypeConverter>) -> &dyn IReactiveUIBuilder
Registers a converter of a pair of types (WithConverter(IBindingTypeConverter)).
with_converter_factory
fn with_converter_factory(self: &Self, factory: &dyn Fn() -> Rc<dyn IBindingTypeConverter>) -> &dyn IReactiveUIBuilder
Registers the converter that factory creates (WithConverter(Func<IBindingTypeConverter>)).
with_fallback_converter
fn with_fallback_converter(self: &Self, converter: Rc<dyn IBindingFallbackConverter>) -> &dyn IReactiveUIBuilder
Registers a fallback converter (WithFallbackConverter(IBindingFallbackConverter)).
with_fallback_converter_factory
fn with_fallback_converter_factory(self: &Self, factory: &dyn Fn() -> Rc<dyn IBindingFallbackConverter>) -> &dyn IReactiveUIBuilder
Registers the fallback converter that factory creates
(WithFallbackConverter(Func<IBindingFallbackConverter>)).
with_set_method_converter
fn with_set_method_converter(self: &Self, converter: Rc<dyn ISetMethodBindingConverter>) -> &dyn IReactiveUIBuilder
Registers a set-method converter (WithSetMethodConverter(ISetMethodBindingConverter)).
with_set_method_converter_factory
fn with_set_method_converter_factory(self: &Self, factory: &dyn Fn() -> Rc<dyn ISetMethodBindingConverter>) -> &dyn IReactiveUIBuilder
Registers the set-method converter that factory creates
(WithSetMethodConverter(Func<ISetMethodBindingConverter>)).
with_converters_from
fn with_converters_from(self: &Self, resolver: &dyn IReadonlyDependencyResolver) -> &dyn IReactiveUIBuilder
Registers the converters of the three kinds that resolver has
(WithConvertersFrom(IReadonlyDependencyResolver)).
using_splat_module
fn using_splat_module(self: &Self, registration_module: Rc<dyn IModule>) -> &dyn IReactiveUIBuilder
Adds a Splat module (UsingSplatModule<T>(T)).
using_splat_builder
fn using_splat_builder(self: &Self, app_builder: Option<&dyn Fn(&dyn IAppBuilder) -> ()>) -> &dyn IReactiveUIBuilder
Calls app_builder, if any, with the builder as a Splat builder
(UsingSplatBuilder(Action<IAppBuilder>)).
build_app
fn build_app(self: &Self) -> &dyn IReactiveUIInstance
Builds the application once, with its core services, and initializes the state of
ReactiveUI (Build() and BuildApp()).
Panics
When the application has no resolver (InvalidOperationException).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.