Struct tauri::window::Window[][src]

pub struct Window<R: Runtime = Wry> { /* fields omitted */ }
Expand description

A webview window managed by Tauri.

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

Implementations

Creates a new webview window.

The label of this window.

Emits an event to the current window.

Emits an event on all windows except this one.

Listen to an event on this window.

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

Triggers an event on this window.

Evaluates JavaScript on this window.

Registers a window event listener.

This is supported on crate feature menu only.

Registers a menu event listener.

Gets a handle to the window menu.

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

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

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.

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

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

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

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.

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

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.

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

Gets the window’s current fullscreen state.

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

Gets the window’s current maximized state.

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

Gets the window’s current decoration state.

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

Gets the window’s current resizable state.

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

Gets the window’s current vibility state.

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

Returns the monitor on which the window currently resides.

Returns None if current monitor can’t be detected.

Platform-specific

  • Linux: Unsupported

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

Returns the primary monitor of the system.

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

Platform-specific

  • Linux: Unsupported

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

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

Platform-specific

  • Linux: Unsupported

Panics

Panics if the app is not running yet, usually when called on the setup closure. You can spawn a task to use the API using the async_runtime to prevent the panic.

Returns the ApplicatonWindow from gtk crate that is used by this window.

Note that this can only be used on the main thread.

Centers the window.

Requests user attention to the window, this has no effect if the application is already focused. How requesting for user attention manifests is platform dependent, see UserAttentionType for details.

Providing None will unset the request for user attention. Unsetting the request for user attention might not be done automatically by the WM when the window receives input.

Platform-specific

  • macOS: None has no effect.

Opens the dialog to prints the contents of the webview. Currently only supported on macOS on wry. window.print() works on all platforms.

Determines if this window should be resizable.

Set this window’s title.

Maximizes this window.

Un-maximizes this window.

Minimizes this window.

Un-minimizes this window.

Show this window.

Hide this window.

Closes this window.

Determines if this window should be decorated.

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

Resizes this window.

Sets this window’s minimum size.

Sets this window’s maximum size.

Sets this window’s position.

Determines if this window should be fullscreen.

Bring the window to front and focus.

Sets this window’ icon.

Whether to show the window icon in the task bar or not.

Starts dragging the window.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Grabs the Window from the CommandItem. This will never fail.

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

Feeds a slice of this type into the given Hasher. Read more

The Config the manager was created with.

Emits a event to all windows.

Emits an event to a window with the specified label.

Listen to a global event.

Listen to a global event only once.

Trigger a global event.

Remove an event listener.

Fetch a single window from the manager.

Fetch all managed windows.

Add state to the state managed by the application. See crate::Builder for instructions. Read more

Gets the managed state for the type T.

Only use the Window’s label to compare equality.

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.