Trait tauri_runtime::RuntimeHandle

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

Show 13 methods // Required methods fn create_proxy(&self) -> <Self::Runtime as Runtime<T>>::EventLoopProxy; fn set_activation_policy( &self, activation_policy: ActivationPolicy ) -> Result<()>; fn request_exit(&self, code: i32) -> Result<()>; fn create_window<F: Fn(RawWindow<'_>) + Send + 'static>( &self, pending: PendingWindow<T, Self::Runtime>, before_window_creation: Option<F> ) -> Result<DetachedWindow<T, Self::Runtime>>; fn create_webview( &self, window_id: WindowId, pending: PendingWebview<T, Self::Runtime> ) -> Result<DetachedWebview<T, Self::Runtime>>; fn run_on_main_thread<F: FnOnce() + Send + 'static>( &self, f: F ) -> Result<()>; fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>; fn primary_monitor(&self) -> Option<Monitor>; fn monitor_from_point(&self, x: f64, y: f64) -> Option<Monitor>; fn available_monitors(&self) -> Vec<Monitor>; fn cursor_position(&self) -> Result<PhysicalPosition<f64>>; 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 set_activation_policy( &self, activation_policy: ActivationPolicy ) -> Result<()>

Available on macOS only.

Sets the activation policy for the application.

source

fn request_exit(&self, code: i32) -> Result<()>

Requests an exit of the event loop.

source

fn create_window<F: Fn(RawWindow<'_>) + Send + 'static>( &self, pending: PendingWindow<T, Self::Runtime>, before_window_creation: Option<F> ) -> Result<DetachedWindow<T, Self::Runtime>>

Create a new window.

source

fn create_webview( &self, window_id: WindowId, pending: PendingWebview<T, Self::Runtime> ) -> Result<DetachedWebview<T, Self::Runtime>>

Create a new webview.

source

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

Run a task on the main thread.

source

fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>

source

fn primary_monitor(&self) -> Option<Monitor>

source

fn monitor_from_point(&self, x: f64, y: f64) -> Option<Monitor>

source

fn available_monitors(&self) -> Vec<Monitor>

source

fn cursor_position(&self) -> Result<PhysicalPosition<f64>>

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.

Object Safety§

This trait is not object safe.

Implementors§