#[non_exhaustive]pub enum RunEvent {
Exit,
ExitRequested {
code: Option<i32>,
api: ExitRequestApi,
},
WindowEvent {
label: String,
event: WindowEvent,
},
WebviewEvent {
label: String,
event: WebviewEvent,
},
Ready,
Resumed,
MainEventsCleared,
MenuEvent(MenuEvent),
TrayIconEvent(TrayIconEvent),
}Expand description
An application event, triggered from the event loop.
See App::run for usage examples.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Exit
Event loop is exiting.
ExitRequested
The app is about to exit
Fields
This variant is marked as non-exhaustive
code: Option<i32>Exit code.
Option::None when the exit is requested by user interaction,
Option::Some when requested programmatically via AppHandle and AppHandle.
api: ExitRequestApiEvent API
WindowEvent
An event associated with a window.
Fields
This variant is marked as non-exhaustive
event: WindowEventThe detailed event.
WebviewEvent
An event associated with a webview.
Fields
This variant is marked as non-exhaustive
event: WebviewEventThe detailed event.
Ready
Application ready.
Resumed
Sent if the event loop is being resumed.
MainEventsCleared
Emitted when all of the event loop’s input events have been processed and redraw processing is about to begin.
This event is useful as a place to put your code that should be run after all state-changing events have been handled and you want to do stuff (updating state, performing calculations, etc) that happens as the “main body” of your event loop.
MenuEvent(MenuEvent)
desktop only.An event from a menu item, could be on the window menu bar, application menu bar (on macOS) or tray icon menu.
TrayIconEvent(TrayIconEvent)
desktop and crate feature tray-icon only.An event from a tray icon.