Skip to main content

Trait tauri::Runtime

pub trait Runtime: 'static {
    type Dispatcher: Dispatch;
    type Handle: RuntimeHandle;
    type GlobalShortcutManager: GlobalShortcutManager + Clone + Send;
    type ClipboardManager: ClipboardManager + Clone + Send;
    fn new() -> Result<Self, Error>;

    fn handle(&self) -> Self::Handle;

    fn global_shortcut_manager(&self) -> Self::GlobalShortcutManager;

    fn clipboard_manager(&self) -> Self::ClipboardManager;

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

    fn run<F>(self, callback: F)
    where
        F: 'static + Fn(RunEvent);
}

Expand description

The webview runtime interface.

Associated Types#

type Dispatcher: Dispatch#

The message dispatcher.

type Handle: RuntimeHandle#

The runtime handle type.

type GlobalShortcutManager: GlobalShortcutManager + Clone + Send#

The global shortcut manager type.

type ClipboardManager: ClipboardManager + Clone + Send#

The clipboard manager type.

Required methods#

fn new() -> Result<Self, Error>#

Creates a new webview runtime.

fn handle(&self) -> Self::Handle#

Gets a runtime handle.

fn global_shortcut_manager(&self) -> Self::GlobalShortcutManager#

Gets the global shortcut manager.

fn clipboard_manager(&self) -> Self::ClipboardManager#

Gets the clipboard manager.

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

Create a new webview window.

fn run<F>(self, callback: F) where F: 'static + Fn(RunEvent),#

Run the webview runtime.

Implementors#

impl Runtime for Wry#

type Dispatcher = WryDispatcher#

type Handle = WryHandle#

type GlobalShortcutManager = GlobalShortcutManagerHandle#

type ClipboardManager = ClipboardManagerWrapper#

pub fn new() -> Result<Wry, Error>#

pub fn handle(&self) -> <Wry as Runtime>::Handle#

pub fn global_shortcut_manager(&self) -> <Wry as Runtime>::GlobalShortcutManager#

pub fn clipboard_manager(&self) -> <Wry as Runtime>::ClipboardManager#

pub fn create_window( &self, pending: PendingWindow<Wry> ) -> Result<DetachedWindow<Wry>, Error>#

pub fn run<F>(self, callback: F) where F: 'static + Fn(RunEvent),#