pub trait RuntimeHandle<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 'static {
    type Runtime: Runtime<T, Handle = Self>;

    fn create_proxy(&self) -> <Self::Runtime as Runtime<T>>::EventLoopProxy;
    fn create_window(
        &self,
        pending: PendingWindow<T, Self::Runtime>
    ) -> Result<DetachedWindow<T, Self::Runtime>>; fn run_on_main_thread<F: FnOnce() + Send + 'static>(
        &self,
        f: F
    ) -> Result<()>; fn system_tray(
        &self,
        system_tray: SystemTray
    ) -> Result<<Self::Runtime as Runtime<T>>::TrayHandler>; fn raw_display_handle(&self) -> RawDisplayHandle; fn show(&self) -> Result<()>; fn hide(&self) -> Result<()>; }
Expand description

A Send handle to the runtime.

Required Associated Types§

source

type Runtime: Runtime<T, Handle = Self>

Required Methods§

source

fn create_proxy(&self) -> <Self::Runtime as Runtime<T>>::EventLoopProxy

Creates an EventLoopProxy that can be used to dispatch user events to the main event loop.

source

fn create_window(
    &self,
    pending: PendingWindow<T, Self::Runtime>
) -> Result<DetachedWindow<T, Self::Runtime>>

Create a new webview window.

source

fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>

Run a task on the main thread.

source

fn system_tray(
    &self,
    system_tray: SystemTray
) -> Result<<Self::Runtime as Runtime<T>>::TrayHandler>

Available on desktop and crate feature system-tray only.

Adds an icon to the system tray with the specified menu items.

source

fn raw_display_handle(&self) -> RawDisplayHandle

source

fn show(&self) -> Result<()>

Available on macOS only.

Shows the application, but does not automatically focus it.

source

fn hide(&self) -> Result<()>

Available on macOS only.

Hides the application.

Implementors§