pub trait AppRunWindowExt {
// Required method
fn run_window<F>(
self,
window_id: impl Into<WindowId>,
new_window: impl IntoFuture<IntoFuture = F>,
)
where F: Future<Output = WindowRoot> + Send + 'static;
}Expand description
Extension trait, adds run_window to AppBuilder.
Required Methods§
Sourcefn run_window<F>(
self,
window_id: impl Into<WindowId>,
new_window: impl IntoFuture<IntoFuture = F>,
)
fn run_window<F>( self, window_id: impl Into<WindowId>, new_window: impl IntoFuture<IntoFuture = F>, )
Runs the application event loop and requests a new window.
The window opens after the future returns it. The WINDOW context for the new window is already available in the new_window future.
This method only returns when the app has exited.
§Examples
APP.defaults().run_window("main", async {
println!("starting app with window {:?}", WINDOW.id());
Window! {
title = "Window 1";
child = Text!("Window 1");
}
})Which is a shortcut for:
APP.defaults().run(async {
WINDOWS.open("main", async {
println!("starting app with window {:?}", WINDOW.id());
Window! {
title = "Window 1";
child = Text!("Window 1");
}
});
})Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.