wingy_core/event_loop/register.rs
1use crate::application::ApplicationHandler;
2
3/// Additional methods on `EventLoop` that registers it with the system event loop.
4pub trait EventLoopExtRegister {
5 /// Initialize and register the application with the system's event loop, such that the
6 /// callbacks will be run later.
7 ///
8 /// ## Platform-specific
9 ///
10 /// - **Web**: Once the event loop has been destroyed, it's possible to reinitialize another
11 /// event loop by calling this function again. This can be useful if you want to recreate the
12 /// event loop while the WebAssembly module is still loaded. For example, this can be used to
13 /// recreate the event loop when switching between tabs on a single page application.
14 /// - **iOS/macOS**: Unimplemented.
15 /// - **Android/Orbital/Wayland/Windows/X11**: Unsupported.
16 fn register_app<A: ApplicationHandler + 'static>(self, app: A);
17}