Trait tauri_runtime::Runtime [−][src]
pub trait Runtime: Sized + 'static { type Dispatcher: Dispatch<Runtime = Self>; type Handle: RuntimeHandle<Runtime = Self>; type GlobalShortcutManager: GlobalShortcutManager + Clone + Send; type ClipboardManager: ClipboardManager + Clone + Send; type TrayHandler: TrayHandle + Clone + Send; fn new() -> Result<Self>; fn handle(&self) -> Self::Handle; fn global_shortcut_manager(&self) -> Self::GlobalShortcutManager; fn clipboard_manager(&self) -> Self::ClipboardManager; fn create_window<P: Params<Runtime = Self>>(
&self,
pending: PendingWindow<P>
) -> Result<DetachedWindow<P>>; fn system_tray<I: MenuId>(
&self,
system_tray: SystemTray<I>
) -> Result<Self::TrayHandler>; fn on_system_tray_event<F: Fn(&SystemTrayEvent) + Send + 'static>(
&mut self,
f: F
) -> Uuid; fn run<F: Fn(RunEvent) + 'static>(self, callback: F); }
Expand description
The webview runtime interface.
Associated Types
type Dispatcher: Dispatch<Runtime = Self>
type Dispatcher: Dispatch<Runtime = Self>
The message dispatcher.
type Handle: RuntimeHandle<Runtime = Self>
type Handle: RuntimeHandle<Runtime = Self>
The runtime handle type.
The global shortcut manager type.
type ClipboardManager: ClipboardManager + Clone + Send
type ClipboardManager: ClipboardManager + Clone + Send
The clipboard manager type.
type TrayHandler: TrayHandle + Clone + Send
type TrayHandler: TrayHandle + Clone + Send
The tray handler type.
Required methods
fn global_shortcut_manager(&self) -> Self::GlobalShortcutManager
fn global_shortcut_manager(&self) -> Self::GlobalShortcutManager
Gets the global shortcut manager.
fn clipboard_manager(&self) -> Self::ClipboardManager
fn clipboard_manager(&self) -> Self::ClipboardManager
Gets the clipboard manager.
fn create_window<P: Params<Runtime = Self>>(
&self,
pending: PendingWindow<P>
) -> Result<DetachedWindow<P>>
fn create_window<P: Params<Runtime = Self>>(
&self,
pending: PendingWindow<P>
) -> Result<DetachedWindow<P>>
Create a new webview window.
fn system_tray<I: MenuId>(
&self,
system_tray: SystemTray<I>
) -> Result<Self::TrayHandler>
fn system_tray<I: MenuId>(
&self,
system_tray: SystemTray<I>
) -> Result<Self::TrayHandler>
This is supported on crate feature
system-tray
only.Adds the icon to the system tray with the specified menu items.
fn on_system_tray_event<F: Fn(&SystemTrayEvent) + Send + 'static>(
&mut self,
f: F
) -> Uuid
fn on_system_tray_event<F: Fn(&SystemTrayEvent) + Send + 'static>(
&mut self,
f: F
) -> Uuid
This is supported on crate feature
system-tray
only.Registers a system tray event handler.