# IReactiveUIBuilder

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/builder/trait-ireactiveuibuilder/

**trait** · [`ferroui-reactiveui`](/docs/0.5.0/api/ferroui-reactiveui/) · v0.5.0

```rust
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`](/docs/0.5.0/api/ferroui-reactiveui/builder/trait-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.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L29)

## Members

- [`with_message_bus`](#function-with_message_bus)
- [`with_message_bus_with`](#function-with_message_bus_with)
- [`with_message_bus_instance`](#function-with_message_bus_instance)
- [`configure_suspension_driver`](#function-configure_suspension_driver)
- [`configure_view_locator`](#function-configure_view_locator)
- [`for_custom_platform`](#function-for_custom_platform)
- [`for_platforms`](#function-for_platforms)
- [`with_main_thread_scheduler`](#function-with_main_thread_scheduler)
- [`with_main_thread_scheduler_with`](#function-with_main_thread_scheduler_with)
- [`with_platform_services`](#function-with_platform_services)
- [`with_registration`](#function-with_registration)
- [`with_registrations`](#function-with_registrations)
- [`with_registration_on_build`](#function-with_registration_on_build)
- [`with_task_pool_scheduler`](#function-with_task_pool_scheduler)
- [`with_task_pool_scheduler_with`](#function-with_task_pool_scheduler_with)
- [`with_exception_handler`](#function-with_exception_handler)
- [`with_suspension_host`](#function-with_suspension_host)
- [`with_suspension_host_instance`](#function-with_suspension_host_instance)
- [`with_cache_sizes`](#function-with_cache_sizes)
- [`with_converter`](#function-with_converter)
- [`with_converter_factory`](#function-with_converter_factory)
- [`with_fallback_converter`](#function-with_fallback_converter)
- [`with_fallback_converter_factory`](#function-with_fallback_converter_factory)
- [`with_set_method_converter`](#function-with_set_method_converter)
- [`with_set_method_converter_factory`](#function-with_set_method_converter_factory)
- [`with_converters_from`](#function-with_converters_from)
- [`using_splat_module`](#function-using_splat_module)
- [`using_splat_builder`](#function-using_splat_builder)
- [`build_app`](#function-build_app)

<a id="function-with_message_bus"></a>

### with_message_bus

```rust
fn with_message_bus(self: &Self) -> &dyn IReactiveUIBuilder
```

Registers a new message bus when the application is built (`WithMessageBus()`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L31)

<a id="function-with_message_bus_with"></a>

### with_message_bus_with

```rust
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>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L35)

<a id="function-with_message_bus_instance"></a>

### with_message_bus_instance

```rust
fn with_message_bus_instance(self: &Self, message_bus: Rc<dyn IMessageBus>) -> &dyn IReactiveUIBuilder
```

Registers `message_bus` when the application is built (`WithMessageBus(IMessageBus)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L38)

<a id="function-configure_suspension_driver"></a>

### configure_suspension_driver

```rust
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>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L42)

<a id="function-configure_view_locator"></a>

### configure_view_locator

```rust
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>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L47)

<a id="function-for_custom_platform"></a>

### for_custom_platform

```rust
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>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L52)

<a id="function-for_platforms"></a>

### for_platforms

```rust
fn for_platforms(self: &Self, platform_configurations: &[&dyn Fn(&dyn IReactiveUIBuilder) -> ()]) -> &dyn IReactiveUIBuilder
```

Applies the configuration of each platform (`ForPlatforms(params Action<IReactiveUIBuilder>[])`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L55)

<a id="function-with_main_thread_scheduler"></a>

### with_main_thread_scheduler

```rust
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)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L60)

<a id="function-with_main_thread_scheduler_with"></a>

### with_main_thread_scheduler_with

```rust
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)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L64)

<a id="function-with_platform_services"></a>

### with_platform_services

```rust
fn with_platform_services(self: &Self) -> &dyn IReactiveUIBuilder
```

Registers the services of the platform, once (`WithPlatformServices`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L67)

<a id="function-with_registration"></a>

### with_registration

```rust
fn with_registration(self: &Self, configure_action: &dyn Fn(&dyn IMutableDependencyResolver) -> ()) -> &dyn IReactiveUIBuilder
```

Applies `configure_action` to the resolver at once (`WithRegistration(Action<IMutableDependencyResolver>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L70)

<a id="function-with_registrations"></a>

### with_registrations

```rust
fn with_registrations(self: &Self, registration: &dyn IWantsToRegisterStuff) -> &dyn IReactiveUIBuilder
```

Applies `registration` to the resolver at once, through a `DependencyResolverRegistrar`
(`WithRegistration(IWantsToRegisterStuff)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L74)

<a id="function-with_registration_on_build"></a>

### with_registration_on_build

```rust
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>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L78)

<a id="function-with_task_pool_scheduler"></a>

### with_task_pool_scheduler

```rust
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)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L83)

<a id="function-with_task_pool_scheduler_with"></a>

### with_task_pool_scheduler_with

```rust
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)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L87)

<a id="function-with_exception_handler"></a>

### with_exception_handler

```rust
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>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L91)

<a id="function-with_suspension_host"></a>

### with_suspension_host

```rust
fn with_suspension_host(self: &Self) -> &dyn IReactiveUIBuilder
```

Sets a suspension host, which becomes the one of `RxSuspension` when the application is
built (`WithSuspensionHost()`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L95)

<a id="function-with_suspension_host_instance"></a>

### with_suspension_host_instance

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L99)

<a id="function-with_cache_sizes"></a>

### with_cache_sizes

```rust
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`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L105)

<a id="function-with_converter"></a>

### with_converter

```rust
fn with_converter(self: &Self, converter: Rc<dyn IBindingTypeConverter>) -> &dyn IReactiveUIBuilder
```

Registers a converter of a pair of types (`WithConverter(IBindingTypeConverter)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L108)

<a id="function-with_converter_factory"></a>

### with_converter_factory

```rust
fn with_converter_factory(self: &Self, factory: &dyn Fn() -> Rc<dyn IBindingTypeConverter>) -> &dyn IReactiveUIBuilder
```

Registers the converter that `factory` creates (`WithConverter(Func<IBindingTypeConverter>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L111)

<a id="function-with_fallback_converter"></a>

### with_fallback_converter

```rust
fn with_fallback_converter(self: &Self, converter: Rc<dyn IBindingFallbackConverter>) -> &dyn IReactiveUIBuilder
```

Registers a fallback converter (`WithFallbackConverter(IBindingFallbackConverter)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L114)

<a id="function-with_fallback_converter_factory"></a>

### with_fallback_converter_factory

```rust
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>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L118)

<a id="function-with_set_method_converter"></a>

### with_set_method_converter

```rust
fn with_set_method_converter(self: &Self, converter: Rc<dyn ISetMethodBindingConverter>) -> &dyn IReactiveUIBuilder
```

Registers a set-method converter (`WithSetMethodConverter(ISetMethodBindingConverter)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L121)

<a id="function-with_set_method_converter_factory"></a>

### with_set_method_converter_factory

```rust
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>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L125)

<a id="function-with_converters_from"></a>

### with_converters_from

```rust
fn with_converters_from(self: &Self, resolver: &dyn IReadonlyDependencyResolver) -> &dyn IReactiveUIBuilder
```

Registers the converters of the three kinds that `resolver` has
(`WithConvertersFrom(IReadonlyDependencyResolver)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L129)

<a id="function-using_splat_module"></a>

### using_splat_module

```rust
fn using_splat_module(self: &Self, registration_module: Rc<dyn IModule>) -> &dyn IReactiveUIBuilder
```

Adds a Splat module (`UsingSplatModule<T>(T)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L132)

<a id="function-using_splat_builder"></a>

### using_splat_builder

```rust
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>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L136)

<a id="function-build_app"></a>

### build_app

```rust
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`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/builder/i_reactive_ui_builder.rs#L143)

## Trait implementations

- [`IReactiveUIBuilder`](/docs/0.5.0/api/ferroui-reactiveui/builder/trait-ireactiveuibuilder/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
