logo
pub struct RelmApp<Model> where
    Model: ModelTrait + AppUpdate + 'static,
    Model::Widgets: WidgetsTrait<Model, ()> + 'static,
    <Model::Widgets as WidgetsTrait<Model, ()>>::Root: IsA<ApplicationWindow> + IsA<Window>,
    Model::Components: Components<Model> + 'static, 
{ /* private fields */ }
Expand description

The app that runs the main application. A RelmApp consists of a model that stores the application state and widgets that represent the UI.

A RelmApp might run as a standalone application or may contain multiple components that communicate with each other.

Implementations

Runs the application, returns once the application is closed.

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

Examples found in repository
relm4-examples/examples/open_button.rs (line 99)
96
97
98
99
100
fn main() {
    let model = AppModel {};
    let app = RelmApp::new(model);
    app.run();
}
More examples
relm4-examples/examples/stack_switcher.rs (line 132)
129
130
131
132
133
fn main() {
    let model = AppModel {};
    let relm = RelmApp::new(model);
    relm.run();
}
relm4-examples/libadwaita/examples/sudoku_solver.rs (line 189)
185
186
187
188
189
190
fn main() {
    let model = AppModel::new();

    let relm = RelmApp::new(model);
    relm.run();
}
relm4-examples/libadwaita/examples/simple.rs (line 80)
77
78
79
80
81
fn main() {
    let model = AppModel::default();
    let app = RelmApp::new(model);
    app.run();
}
relm4-examples/examples/micro_components_manual.rs (line 165)
162
163
164
165
166
fn main() {
    let model = AppModel::default();
    let app = RelmApp::new(model);
    app.run();
}
relm4-examples/examples/popover.rs (line 82)
79
80
81
82
83
fn main() {
    let model = AppModel::default();
    let app = RelmApp::new(model);
    app.run();
}

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

Create a Relm4 application.

Examples found in repository
relm4-examples/examples/open_button.rs (line 98)
96
97
98
99
100
fn main() {
    let model = AppModel {};
    let app = RelmApp::new(model);
    app.run();
}
More examples
relm4-examples/examples/stack_switcher.rs (line 131)
129
130
131
132
133
fn main() {
    let model = AppModel {};
    let relm = RelmApp::new(model);
    relm.run();
}
relm4-examples/libadwaita/examples/sudoku_solver.rs (line 188)
185
186
187
188
189
190
fn main() {
    let model = AppModel::new();

    let relm = RelmApp::new(model);
    relm.run();
}
relm4-examples/libadwaita/examples/simple.rs (line 79)
77
78
79
80
81
fn main() {
    let model = AppModel::default();
    let app = RelmApp::new(model);
    app.run();
}
relm4-examples/examples/micro_components_manual.rs (line 164)
162
163
164
165
166
fn main() {
    let model = AppModel::default();
    let app = RelmApp::new(model);
    app.run();
}
relm4-examples/examples/popover.rs (line 81)
79
80
81
82
83
fn main() {
    let model = AppModel::default();
    let app = RelmApp::new(model);
    app.run();
}

Create a new Relm4 application with an existing gtk::Application.

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.

Calls U::from(self).

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

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.