Trait tauri_runtime::Dispatch[][src]

pub trait Dispatch: Clone + Send + Sized + 'static {
    type Runtime: Runtime;
    type WindowBuilder: WindowBuilder + Clone;
Show methods fn run_on_main_thread<F: FnOnce() + Send + 'static>(
        &self,
        f: F
    ) -> Result<()>;
fn on_window_event<F: Fn(&WindowEvent) + Send + 'static>(
        &self,
        f: F
    ) -> Uuid;
fn on_menu_event<F: Fn(&MenuEvent) + Send + 'static>(&self, f: F) -> Uuid;
fn scale_factor(&self) -> Result<f64>;
fn inner_position(&self) -> Result<PhysicalPosition<i32>>;
fn outer_position(&self) -> Result<PhysicalPosition<i32>>;
fn inner_size(&self) -> Result<PhysicalSize<u32>>;
fn outer_size(&self) -> Result<PhysicalSize<u32>>;
fn is_fullscreen(&self) -> Result<bool>;
fn is_maximized(&self) -> Result<bool>;
fn current_monitor(&self) -> Result<Option<Monitor>>;
fn primary_monitor(&self) -> Result<Option<Monitor>>;
fn available_monitors(&self) -> Result<Vec<Monitor>>;
fn print(&self) -> Result<()>;
fn create_window<P: Params<Runtime = Self::Runtime>>(
        &mut self,
        pending: PendingWindow<P>
    ) -> Result<DetachedWindow<P>>;
fn set_resizable(&self, resizable: bool) -> Result<()>;
fn set_title<S: Into<String>>(&self, title: S) -> Result<()>;
fn maximize(&self) -> Result<()>;
fn unmaximize(&self) -> Result<()>;
fn minimize(&self) -> Result<()>;
fn unminimize(&self) -> Result<()>;
fn show(&self) -> Result<()>;
fn hide(&self) -> Result<()>;
fn close(&self) -> Result<()>;
fn set_decorations(&self, decorations: bool) -> Result<()>;
fn set_always_on_top(&self, always_on_top: bool) -> Result<()>;
fn set_size(&self, size: Size) -> Result<()>;
fn set_min_size(&self, size: Option<Size>) -> Result<()>;
fn set_max_size(&self, size: Option<Size>) -> Result<()>;
fn set_position(&self, position: Position) -> Result<()>;
fn set_fullscreen(&self, fullscreen: bool) -> Result<()>;
fn set_icon(&self, icon: Icon) -> Result<()>;
fn start_dragging(&self) -> Result<()>;
fn eval_script<S: Into<String>>(&self, script: S) -> Result<()>;
}
Expand description

Webview dispatcher. A thread-safe handle to the webview API.

Associated Types

type Runtime: Runtime[src]

Expand description

The runtime this Dispatch runs under.

type WindowBuilder: WindowBuilder + Clone[src]

Expand description

The winoow builder type.

Loading content...

Required methods

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

Expand description

Run a task on the main thread.

fn on_window_event<F: Fn(&WindowEvent) + Send + 'static>(&self, f: F) -> Uuid[src]

Expand description

Registers a window event handler.

fn on_menu_event<F: Fn(&MenuEvent) + Send + 'static>(&self, f: F) -> Uuid[src]

This is supported on crate feature menu only.
Expand description

Registers a window event handler.

fn scale_factor(&self) -> Result<f64>[src]

Expand description

Returns the scale factor that can be used to map logical pixels to physical pixels, and vice versa.

fn inner_position(&self) -> Result<PhysicalPosition<i32>>[src]

Expand description

Returns the position of the top-left hand corner of the window’s client area relative to the top-left hand corner of the desktop.

fn outer_position(&self) -> Result<PhysicalPosition<i32>>[src]

Expand description

Returns the position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.

fn inner_size(&self) -> Result<PhysicalSize<u32>>[src]

Expand description

Returns the physical size of the window’s client area.

The client area is the content of the window, excluding the title bar and borders.

fn outer_size(&self) -> Result<PhysicalSize<u32>>[src]

Expand description

Returns the physical size of the entire window.

These dimensions include the title bar and borders. If you don’t want that (and you usually don’t), use inner_size instead.

fn is_fullscreen(&self) -> Result<bool>[src]

Expand description

Gets the window’s current fullscreen state.

fn is_maximized(&self) -> Result<bool>[src]

Expand description

Gets the window’s current maximized state.

fn current_monitor(&self) -> Result<Option<Monitor>>[src]

Expand description

Returns the monitor on which the window currently resides.

Returns None if current monitor can’t be detected.

fn primary_monitor(&self) -> Result<Option<Monitor>>[src]

Expand description

Returns the primary monitor of the system.

Returns None if it can’t identify any monitor as a primary one.

fn available_monitors(&self) -> Result<Vec<Monitor>>[src]

Expand description

Returns the list of all the monitors available on the system.

fn print(&self) -> Result<()>[src]

Expand description

Opens the dialog to prints the contents of the webview.

fn create_window<P: Params<Runtime = Self::Runtime>>(
    &mut self,
    pending: PendingWindow<P>
) -> Result<DetachedWindow<P>>
[src]

Expand description

Create a new webview window.

fn set_resizable(&self, resizable: bool) -> Result<()>[src]

Expand description

Updates the window resizable flag.

fn set_title<S: Into<String>>(&self, title: S) -> Result<()>[src]

Expand description

Updates the window title.

fn maximize(&self) -> Result<()>[src]

Expand description

Maximizes the window.

fn unmaximize(&self) -> Result<()>[src]

Expand description

Unmaximizes the window.

fn minimize(&self) -> Result<()>[src]

Expand description

Minimizes the window.

fn unminimize(&self) -> Result<()>[src]

Expand description

Unminimizes the window.

fn show(&self) -> Result<()>[src]

Expand description

Shows the window.

fn hide(&self) -> Result<()>[src]

Expand description

Hides the window.

fn close(&self) -> Result<()>[src]

Expand description

Closes the window.

fn set_decorations(&self, decorations: bool) -> Result<()>[src]

Expand description

Updates the hasDecorations flag.

fn set_always_on_top(&self, always_on_top: bool) -> Result<()>[src]

Expand description

Updates the window alwaysOnTop flag.

fn set_size(&self, size: Size) -> Result<()>[src]

Expand description

Resizes the window.

fn set_min_size(&self, size: Option<Size>) -> Result<()>[src]

Expand description

Updates the window min size.

fn set_max_size(&self, size: Option<Size>) -> Result<()>[src]

Expand description

Updates the window max size.

fn set_position(&self, position: Position) -> Result<()>[src]

Expand description

Updates the window position.

fn set_fullscreen(&self, fullscreen: bool) -> Result<()>[src]

Expand description

Updates the window fullscreen state.

fn set_icon(&self, icon: Icon) -> Result<()>[src]

Expand description

Updates the window icon.

fn start_dragging(&self) -> Result<()>[src]

Expand description

Starts dragging the window.

fn eval_script<S: Into<String>>(&self, script: S) -> Result<()>[src]

Expand description

Executes javascript on the window this Dispatch represents.

Loading content...

Implementors

Loading content...