Struct relm4::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.

Examples found in repository?
examples/menu.rs (line 158)
157
158
159
160
fn main() {
    let app = RelmApp::new("relm4.example.menu");
    app.run::<App>(0);
}
More examples
Hide additional examples
examples/simple.rs (line 76)
75
76
77
78
fn main() {
    let app = RelmApp::new("relm4.example.simple");
    app.run::<App>(0);
}
examples/relm4-components/alert.rs (line 146)
145
146
147
148
fn main() {
    let app = RelmApp::new("relm4.example.alert");
    app.run::<App>(());
}
examples/to_do.rs (line 156)
155
156
157
158
fn main() {
    let app = RelmApp::new("relm4.example.to_do");
    app.run::<App>(());
}
examples/entry.rs (line 136)
135
136
137
138
fn main() {
    let app = RelmApp::new("relm4.example.entry");
    app.run::<App>(());
}
examples/factory_async.rs (line 250)
249
250
251
252
fn main() {
    let app = RelmApp::new("relm4.example.factory");
    app.run::<App>(0);
}

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.

Examples found in repository?
examples/menu.rs (line 159)
157
158
159
160
fn main() {
    let app = RelmApp::new("relm4.example.menu");
    app.run::<App>(0);
}
More examples
Hide additional examples
examples/simple.rs (line 77)
75
76
77
78
fn main() {
    let app = RelmApp::new("relm4.example.simple");
    app.run::<App>(0);
}
examples/relm4-components/alert.rs (line 147)
145
146
147
148
fn main() {
    let app = RelmApp::new("relm4.example.alert");
    app.run::<App>(());
}
examples/to_do.rs (line 157)
155
156
157
158
fn main() {
    let app = RelmApp::new("relm4.example.to_do");
    app.run::<App>(());
}
examples/entry.rs (line 137)
135
136
137
138
fn main() {
    let app = RelmApp::new("relm4.example.entry");
    app.run::<App>(());
}
examples/factory_async.rs (line 251)
249
250
251
252
fn main() {
    let app = RelmApp::new("relm4.example.factory");
    app.run::<App>(0);
}

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

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.

Examples found in repository?
examples/simple_async.rs (line 111)
109
110
111
112
fn main() {
    let app = RelmApp::new("relm4.example.simple_async");
    app.run_async::<App>(0);
}

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

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. 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