Struct tauri::Window[][src]

pub struct Window<P: Params> { /* fields omitted */ }

A webview window managed by Tauri.

This type also implements Manager which allows you to manage other windows attached to the same application.

TODO: expand these docs since this is a pretty important type

Implementations

impl<P: Params> Window<P>[src]

pub fn label(&self) -> &P::Label[src]

The label of this window.

pub fn emit<S: Serialize>(
    &self,
    event: &P::Event,
    payload: Option<S>
) -> Result<()>
[src]

Emits an event to the current window.

pub fn emit_others<S: Serialize + Clone>(
    &self,
    event: P::Event,
    payload: Option<S>
) -> Result<()>
[src]

Emits an event on all windows except this one.

pub fn listen<F>(&self, event: P::Event, handler: F) -> EventHandler where
    F: Fn(Event) + Send + 'static, 
[src]

Listen to an event on this window.

pub fn once<F>(&self, event: P::Event, handler: F) -> EventHandler where
    F: Fn(Event) + Send + 'static, 
[src]

Listen to a an event on this window a single time.

pub fn trigger(&self, event: P::Event, data: Option<String>)[src]

Triggers an event on this window.

pub fn eval(&self, js: &str) -> Result<()>[src]

Evaluates JavaScript on this window.

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

Determines if this window should be resizable.

pub fn set_title(&self, title: &str) -> Result<()>[src]

Set this window’s title.

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

Maximizes this window.

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

Un-maximizes this window.

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

Minimizes this window.

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

Un-minimizes this window.

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

Show this window.

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

Hide this window.

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

Closes this window.

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

Determines if this window should be decorated.

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

Determines if this window should always be on top of other windows.

pub fn set_width(&self, width: impl Into<f64>) -> Result<()>[src]

Sets this window’s width.

pub fn set_height(&self, height: impl Into<f64>) -> Result<()>[src]

Sets this window’s height.

pub fn resize(
    &self,
    width: impl Into<f64>,
    height: impl Into<f64>
) -> Result<()>
[src]

Resizes this window.

pub fn set_min_size(
    &self,
    min_width: impl Into<f64>,
    min_height: impl Into<f64>
) -> Result<()>
[src]

Sets this window’s minimum size.

pub fn set_max_size(
    &self,
    max_width: impl Into<f64>,
    max_height: impl Into<f64>
) -> Result<()>
[src]

Sets this window’s maximum size.

pub fn set_x(&self, x: impl Into<f64>) -> Result<()>[src]

Sets this window’s x position.

pub fn set_y(&self, y: impl Into<f64>) -> Result<()>[src]

Sets this window’s y position.

pub fn set_position(&self, x: impl Into<f64>, y: impl Into<f64>) -> Result<()>[src]

Sets this window’s position.

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

Determines if this window should be fullscreen.

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

Sets this window’ icon.

Trait Implementations

impl<M: Params> Clone for Window<M>[src]

impl<P: Params> Eq for Window<P>[src]

impl<P: Params> Hash for Window<P>[src]

fn hash<H: Hasher>(&self, state: &mut H)[src]

Only use the Window’s label to represent its hash.

impl<P: Params> Manager<P> for Window<P>[src]

impl<P: Params> PartialEq<Window<P>> for Window<P>[src]

fn eq(&self, other: &Self) -> bool[src]

Only use the Window’s label to compare equality.

Auto Trait Implementations

impl<P> !RefUnwindSafe for Window<P>

impl<P> Send for Window<P>

impl<P> Sync for Window<P> where
    <<P as Params>::Runtime as Runtime>::Dispatcher: Sync

impl<P> Unpin for Window<P> where
    <<P as Params>::Runtime as Runtime>::Dispatcher: Unpin,
    <P as Params>::Label: Unpin

impl<P> !UnwindSafe for Window<P>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,