#[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,
Opened {
urls: Vec<Url>,
},
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
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 programatically via AppHandle
and AppHandle
.
api: ExitRequestApi
Event API
The app is about to exit
WindowEvent
Fields
This variant is marked as non-exhaustive
event: WindowEvent
The detailed event.
An event associated with a window.
WebviewEvent
Fields
This variant is marked as non-exhaustive
event: WebviewEvent
The detailed event.
An event associated with a webview.
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.
Opened
ios
only.Emitted when the user wants to open the specified resource with the app.
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.