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]
&self,
event: &P::Event,
payload: Option<S>
) -> Result<()>
Emits an event to the current window.
pub fn emit_others<S: Serialize + Clone>(
&self,
event: P::Event,
payload: Option<S>
) -> Result<()>
[src]
&self,
event: P::Event,
payload: Option<S>
) -> Result<()>
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]
F: Fn(Event) + Send + 'static,
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]
F: Fn(Event) + Send + 'static,
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]
&self,
width: impl Into<f64>,
height: impl Into<f64>
) -> Result<()>
Resizes this window.
pub fn set_min_size(
&self,
min_width: impl Into<f64>,
min_height: impl Into<f64>
) -> Result<()>
[src]
&self,
min_width: impl Into<f64>,
min_height: impl Into<f64>
) -> Result<()>
Sets this window’s minimum size.
pub fn set_max_size(
&self,
max_width: impl Into<f64>,
max_height: impl Into<f64>
) -> Result<()>
[src]
&self,
max_width: impl Into<f64>,
max_height: impl Into<f64>
) -> Result<()>
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]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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.
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<P: Params> Manager<P> for Window<P>
[src]
fn config(&self) -> &Config
[src]
fn emit_all<S: Serialize + Clone>(
&self,
event: M::Event,
payload: Option<S>
) -> Result<()>
[src]
&self,
event: M::Event,
payload: Option<S>
) -> Result<()>
fn emit_to<S: Serialize + Clone>(
&self,
label: &M::Label,
event: M::Event,
payload: Option<S>
) -> Result<()>
[src]
&self,
label: &M::Label,
event: M::Event,
payload: Option<S>
) -> Result<()>
fn create_window(&mut self, pending: PendingWindow<M>) -> Result<Window<M>>
[src]
fn listen_global<F>(&self, event: M::Event, handler: F) -> EventHandler where
F: Fn(Event) + Send + 'static,
[src]
F: Fn(Event) + Send + 'static,
fn once_global<F>(&self, event: M::Event, handler: F) -> EventHandler where
F: Fn(Event) + Send + 'static,
[src]
F: Fn(Event) + Send + 'static,
fn trigger_global(&self, event: M::Event, data: Option<String>)
[src]
fn unlisten(&self, handler_id: EventHandler)
[src]
fn get_window(&self, label: &M::Label) -> Option<Window<M>>
[src]
fn windows(&self) -> HashMap<M::Label, Window<M>>
[src]
impl<P: Params> PartialEq<Window<P>> for Window<P>
[src]
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,
<<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,
<<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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,