# AppBuilder

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/struct-appbuilder/

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

```rust
struct AppBuilder
```

Initializes platform-specific services for an [`Application`](/docs/0.5.0/api/ferroui-controls/struct-application/).

The builder is a shared handle: the configuration methods return a clone
of it so that calls can be chained, and the callbacks registered with it
receive it back.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L22)

## Members

- [`setup_with_classic_desktop_lifetime`](#function-setup_with_classic_desktop_lifetime)
- [`setup_with_classic_desktop_lifetime_with`](#function-setup_with_classic_desktop_lifetime_with)
- [`start_with_classic_desktop_lifetime`](#function-start_with_classic_desktop_lifetime)
- [`start_with_classic_desktop_lifetime_with`](#function-start_with_classic_desktop_lifetime_with)
- [`start_with_classic_desktop_lifetime_and_shutdown_mode`](#function-start_with_classic_desktop_lifetime_and_shutdown_mode)
- [`runtime_platform_services_initializer`](#function-runtime_platform_services_initializer)
- [`runtime_platform_services_name`](#function-runtime_platform_services_name)
- [`instance`](#function-instance)
- [`application_type`](#function-application_type)
- [`windowing_subsystem_initializer`](#function-windowing_subsystem_initializer)
- [`windowing_subsystem_name`](#function-windowing_subsystem_name)
- [`rendering_subsystem_initializer`](#function-rendering_subsystem_initializer)
- [`rendering_subsystem_name`](#function-rendering_subsystem_name)
- [`text_shaping_subsystem_initializer`](#function-text_shaping_subsystem_initializer)
- [`text_shaping_subsystem_name`](#function-text_shaping_subsystem_name)
- [`after_setup_callback`](#function-after_setup_callback)
- [`after_platform_services_setup_callback`](#function-after_platform_services_setup_callback)
- [`configure`](#function-configure)
- [`configure_with`](#function-configure_with)
- [`after_setup`](#function-after_setup)
- [`after_application_setup`](#function-after_application_setup)
- [`after_platform_services_setup`](#function-after_platform_services_setup)
- [`start`](#function-start)
- [`setup_without_starting`](#function-setup_without_starting)
- [`setup_with_lifetime`](#function-setup_with_lifetime)
- [`use_windowing_subsystem`](#function-use_windowing_subsystem)
- [`use_rendering_subsystem`](#function-use_rendering_subsystem)
- [`use_text_shaping_subsystem`](#function-use_text_shaping_subsystem)
- [`use_runtime_platform_subsystem`](#function-use_runtime_platform_subsystem)
- [`use_standard_runtime_platform_subsystem`](#function-use_standard_runtime_platform_subsystem)
- [`with`](#function-with)
- [`with_func`](#function-with_func)
- [`configure_fonts`](#function-configure_fonts)
- [`log_to_trace`](#function-log_to_trace)
- [`log_to_text_writer`](#function-log_to_text_writer)
- [`log_to_delegate`](#function-log_to_delegate)
- [`with_system_font_source`](#function-with_system_font_source)

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

### setup_with_classic_desktop_lifetime

```rust
fn setup_with_classic_desktop_lifetime(self: &Self, args: &[String]) -> AppBuilder
```

Sets the application up with a classic desktop lifetime, but doesn't
show the main window and doesn't run the application main loop.

`args` are the startup arguments.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/classic_desktop_style_application_lifetime.rs#L506)

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

### setup_with_classic_desktop_lifetime_with

```rust
fn setup_with_classic_desktop_lifetime_with(self: &Self, args: &[String], lifetime_builder: impl Fn(&Rc<ClassicDesktopStyleApplicationLifetime>) -> ()) -> AppBuilder
```

`setup_with_classic_desktop_lifetime`
with a `lifetime_builder` that modifies the lifetime before the
application is set up. The builder receives the handle of the
lifetime so that it can keep it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/classic_desktop_style_application_lifetime.rs#L515)

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

### start_with_classic_desktop_lifetime

```rust
fn start_with_classic_desktop_lifetime(self: &Self, args: &[String]) -> i32
```

Starts the application with a classic desktop lifetime: sets the
application up, shows the main window and runs the application main
loop where the platform has one.

Returns what `ClassicDesktopStyleApplicationLifetime::start`
returns: the exit code once the main loop has ended or, on platforms
whose dispatcher does not support run loops, immediately after the
start-up, with the application left running (the application, the
lifetime and the windows are owned by the service locator, the class
handlers of the lifetime and the platform windows, not by the
caller).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/classic_desktop_style_application_lifetime.rs#L535)

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

### start_with_classic_desktop_lifetime_with

```rust
fn start_with_classic_desktop_lifetime_with(self: &Self, args: &[String], lifetime_builder: impl Fn(&Rc<ClassicDesktopStyleApplicationLifetime>) -> ()) -> i32
```

`start_with_classic_desktop_lifetime`
with a `lifetime_builder` that modifies the lifetime before the
application is started.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/classic_desktop_style_application_lifetime.rs#L544)

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

### start_with_classic_desktop_lifetime_and_shutdown_mode

```rust
fn start_with_classic_desktop_lifetime_and_shutdown_mode(self: &Self, args: &[String], shutdown_mode: ShutdownMode) -> i32
```

`start_with_classic_desktop_lifetime`
with the shutdown mode of the lifetime.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/classic_desktop_style_application_lifetime.rs#L556)

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

### runtime_platform_services_initializer

```rust
fn runtime_platform_services_initializer(self: &Self) -> Option<Rc<dyn Fn() -> ()>>
```

The method to call to initialize the runtime platform services (e. g.
the asset loader).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L72)

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

### runtime_platform_services_name

```rust
fn runtime_platform_services_name(self: &Self) -> Option<String>
```

The name of the currently selected runtime platform subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L77)

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

### instance

```rust
fn instance(self: &Self) -> Option<Ref<Application>>
```

The `Application` instance being initialized.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L82)

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

### application_type

```rust
fn application_type(self: &Self) -> Option<&'static TypeInfo>
```

The type of the instance (even if it's not created yet).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L87)

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

### windowing_subsystem_initializer

```rust
fn windowing_subsystem_initializer(self: &Self) -> Option<Rc<dyn Fn() -> ()>>
```

The method to call to initialize the windowing subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L92)

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

### windowing_subsystem_name

```rust
fn windowing_subsystem_name(self: &Self) -> Option<String>
```

The name of the currently selected windowing subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L97)

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

### rendering_subsystem_initializer

```rust
fn rendering_subsystem_initializer(self: &Self) -> Option<Rc<dyn Fn() -> ()>>
```

The method to call to initialize the rendering subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L102)

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

### rendering_subsystem_name

```rust
fn rendering_subsystem_name(self: &Self) -> Option<String>
```

The name of the currently selected rendering subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L107)

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

### text_shaping_subsystem_initializer

```rust
fn text_shaping_subsystem_initializer(self: &Self) -> Option<Rc<dyn Fn() -> ()>>
```

The method to call to initialize the text shaping subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L112)

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

### text_shaping_subsystem_name

```rust
fn text_shaping_subsystem_name(self: &Self) -> Option<String>
```

The name of the currently selected text shaping subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L117)

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

### after_setup_callback

```rust
fn after_setup_callback(self: &Self) -> Rc<dyn Fn(&AppBuilder) -> ()>
```

The method to call after the `Application` is set up: it calls the
callbacks registered with `after_setup` in
order.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L124)

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

### after_platform_services_setup_callback

```rust
fn after_platform_services_setup_callback(self: &Self) -> Rc<dyn Fn(&AppBuilder) -> ()>
```

The method to call after the platform services are set up: it calls
the callbacks registered with
`after_platform_services_setup`
in order.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L132)

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

### configure

```rust
fn configure<TApp: NewApplication>() -> AppBuilder
```

Begin configuring an `Application`.

`TApp` is the subclass of `Application` to configure.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L155)

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

### configure_with

```rust
fn configure_with<TApp: ObjectType + Upcast<Application>>(app_factory: impl Fn() -> Ref<TApp> + 'static) -> AppBuilder
```

Begin configuring an `Application` created by `app_factory`.

`app_factory` is useful for passing of dependencies to `TApp`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L162)

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

### after_setup

```rust
fn after_setup(self: &Self, callback: impl Fn(&AppBuilder) -> () + 'static) -> AppBuilder
```

Registers a callback to call after the `Application` is set up.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L172)

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

### after_application_setup

```rust
fn after_application_setup(self: &Self, callback: impl Fn(&AppBuilder) -> () + 'static) -> AppBuilder
```

Registers a callback to call after the `Application` is
initialized and before the callbacks of
`after_setup`. Commonly used by backends to
initialize their views.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L181)

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

### after_platform_services_setup

```rust
fn after_platform_services_setup(self: &Self, callback: impl Fn(&AppBuilder) -> () + 'static) -> AppBuilder
```

Registers a callback to call after the platform services are set up
and before the `Application` is created.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L188)

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

### start

```rust
fn start(self: &Self, main: impl FnOnce(&Ref<Application>, &[String]) -> (), args: &[String])
```

Sets up the application and calls `main` with it. What runs the
application (a lifetime, a platform loop, nothing) is up to `main`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L195)

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

### setup_without_starting

```rust
fn setup_without_starting(self: &Self) -> AppBuilder
```

Sets up the platform-specific services for the application, but does
not run it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L203)

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

### setup_with_lifetime

```rust
fn setup_with_lifetime(self: &Self, lifetime: Rc<dyn IApplicationLifetime>) -> AppBuilder
```

Sets up the platform-specific services for the application and
initializes it with a particular lifetime, but does not run it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L210)

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

### use_windowing_subsystem

```rust
fn use_windowing_subsystem(self: &Self, initializer: impl Fn() -> () + 'static, name: &str) -> AppBuilder
```

Specifies a windowing subsystem to use.

`initializer` is the method to call to initialize the windowing
subsystem and `name` the name of the windowing subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L220)

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

### use_rendering_subsystem

```rust
fn use_rendering_subsystem(self: &Self, initializer: impl Fn() -> () + 'static, name: &str) -> AppBuilder
```

Specifies a rendering subsystem to use.

`initializer` is the method to call to initialize the rendering
subsystem and `name` the name of the rendering subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L230)

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

### use_text_shaping_subsystem

```rust
fn use_text_shaping_subsystem(self: &Self, initializer: impl Fn() -> () + 'static, name: &str) -> AppBuilder
```

Specifies a text shaping subsystem to use.

`initializer` is the method to call to initialize the text shaping
subsystem and `name` the name of the text shaping subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L240)

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

### use_runtime_platform_subsystem

```rust
fn use_runtime_platform_subsystem(self: &Self, initializer: impl Fn() -> () + 'static, name: &str) -> AppBuilder
```

Specifies a runtime platform subsystem to use.

`initializer` is the method to call to initialize the runtime
platform subsystem and `name` the name of the runtime platform
subsystem.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L251)

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

### use_standard_runtime_platform_subsystem

```rust
fn use_standard_runtime_platform_subsystem(self: &Self) -> AppBuilder
```

Specifies a standard runtime platform subsystem to use.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L258)

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

### with

```rust
fn with<T: ?Sized + 'static>(self: &Self, options: Rc<T>) -> AppBuilder
```

Configures platform-specific options: registers `options` as the
service of type `T`, which may be a trait object type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L268)

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

### with_func

```rust
fn with_func<T: ?Sized + 'static>(self: &Self, options: impl Fn() -> Rc<T> + 'static) -> AppBuilder
```

Configures platform-specific options: registers `options` as the
function that produces the service of type `T` on every lookup.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L277)

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

### configure_fonts

```rust
fn configure_fonts(self: &Self, action: impl Fn(&Rc<FontManager>) -> () + 'static) -> AppBuilder
```

Registers an action that is executed with the current font manager.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/app_builder.rs#L287)

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

### log_to_trace

```rust
fn log_to_trace(self: &Self, level: LogEventLevel, areas: &[&str]) -> AppBuilder
```

Logs framework events to the diagnostic trace output of the process.

`level` is the minimum level to log (the reference default is
warning) and `areas` the areas to log; when empty every area is
logged. Valid values are listed in
`LogArea`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/logging_extensions.rs#L14)

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

### log_to_text_writer

```rust
fn log_to_text_writer(self: &Self, writer: impl Write + Send + 'static, level: LogEventLevel, areas: &[&str]) -> AppBuilder
```

Logs framework events to a writer.

`writer` is the writer that is used for log events, one line per
event; `level` is the minimum level to log and `areas` the areas to
log; when empty every area is logged.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/logging_extensions.rs#L24)

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

### log_to_delegate

```rust
fn log_to_delegate(self: &Self, log_callback: impl Fn(&str) -> () + Send + Sync + 'static, level: LogEventLevel, areas: &[&str]) -> AppBuilder
```

Logs framework events to a custom callback.

`log_callback` is the callback that is used for log events, `level`
the minimum level to log and `areas` the areas to log; when empty
every area is logged.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/logging_extensions.rs#L48)

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

### with_system_font_source

```rust
fn with_system_font_source(self: &Self, font_source: url::Url) -> AppBuilder
```

Adds `font_source` to the system fonts once the application is set
up: the fonts of the source become available as if they were
installed in the system. The source is a `file:` URL of a font file or
of a directory of font files, or the URL of font assets (`ferres:`,
`resm:`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/system_font_app_builder_extension.rs#L11)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`

## Availability

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