Struct relm4::prelude::RelmApp

source ·
pub struct RelmApp { /* private fields */ }
Expand description

An app that runs the main application.

Implementations§

Create a new Relm4 application.

This function will create a new gtk::Application object if necessary.

If the libadwaita feature is enabled, then the created gtk::Application will be an instance of adw::Application. This can be overridden by passing your own application object to RelmApp::with_app.

Create a Relm4 application with a provided gtk::Application.

Runs the application, returns once the application is closed.

Unlike [gtk::prelude::ApplicationExtManual::run], this function does not handle command-line arguments. To pass arguments to GTK, use RelmApp::run_with_args.

Runs the application with the provided command-line arguments, returns once the application is closed.

Examples found in repository?
src/app.rs (line 49)
44
45
46
47
48
49
50
    pub fn run<C>(self, payload: C::Init)
    where
        C: Component,
        C::Root: IsA<gtk::Window> + WidgetExt,
    {
        self.run_with_args::<C, &str>(payload, &[]);
    }

Runs the application, returns once the application is closed.

Unlike [gtk::prelude::ApplicationExtManual::run], this function does not handle command-line arguments. To pass arguments to GTK, use RelmApp::run_with_args.

Runs the application with the provided command-line arguments, returns once the application is closed.

Examples found in repository?
src/app.rs (line 104)
99
100
101
102
103
104
105
    pub fn run_async<C>(self, payload: C::Init)
    where
        C: AsyncComponent,
        C::Root: IsA<gtk::Window> + WidgetExt,
    {
        self.run_async_with_args::<C, &str>(payload, &[]);
    }

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Returns the position. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Returns the position. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more