FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    AppBuilder

    struct · ferroui-controls · v0.5.0

    struct AppBuilder
    

    Initializes platform-specific services for an 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

    Members

    setup_with_classic_desktop_lifetime

    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

    setup_with_classic_desktop_lifetime_with

    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

    start_with_classic_desktop_lifetime

    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

    start_with_classic_desktop_lifetime_with

    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

    start_with_classic_desktop_lifetime_and_shutdown_mode

    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

    runtime_platform_services_initializer

    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

    runtime_platform_services_name

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

    The name of the currently selected runtime platform subsystem.

    Source

    instance

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

    The Application instance being initialized.

    Source

    application_type

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

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

    Source

    windowing_subsystem_initializer

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

    The method to call to initialize the windowing subsystem.

    Source

    windowing_subsystem_name

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

    The name of the currently selected windowing subsystem.

    Source

    rendering_subsystem_initializer

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

    The method to call to initialize the rendering subsystem.

    Source

    rendering_subsystem_name

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

    The name of the currently selected rendering subsystem.

    Source

    text_shaping_subsystem_initializer

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

    The method to call to initialize the text shaping subsystem.

    Source

    text_shaping_subsystem_name

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

    The name of the currently selected text shaping subsystem.

    Source

    after_setup_callback

    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

    after_platform_services_setup_callback

    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

    configure

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

    Begin configuring an Application.

    TApp is the subclass of Application to configure.

    Source

    configure_with

    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

    after_setup

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

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

    Source

    after_application_setup

    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

    after_platform_services_setup

    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

    start

    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

    setup_without_starting

    fn setup_without_starting(self: &Self) -> AppBuilder
    

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

    Source

    setup_with_lifetime

    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

    use_windowing_subsystem

    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

    use_rendering_subsystem

    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

    use_text_shaping_subsystem

    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

    use_runtime_platform_subsystem

    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

    use_standard_runtime_platform_subsystem

    fn use_standard_runtime_platform_subsystem(self: &Self) -> AppBuilder
    

    Specifies a standard runtime platform subsystem to use.

    Source

    with

    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

    with_func

    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

    configure_fonts

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

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

    Source

    log_to_trace

    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

    log_to_text_writer

    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

    log_to_delegate

    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

    with_system_font_source

    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

    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
    • ErasedDestructor
    • IntoEither
    • Clone

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.