Struct tauri_sys::window::WebviewWindowBuilder

source ·
pub struct WebviewWindowBuilder<'a> { /* private fields */ }

Implementations§

source§

impl<'a> WebviewWindowBuilder<'a>

source

pub fn new(label: &'a str) -> Self

source

pub fn set_url(&mut self, url: &'a str) -> &mut Self

Remote URL or local file path to open.

  • URL such as https://github.com/tauri-apps is opened directly on a Tauri window.
  • data: URL such as data:text/html,<html>... is only supported with the window-data-url Cargo feature for the tauri dependency.
  • local file path or route such as /path/to/page.html or /users is appended to the application URL (the devServer URL on development, or tauri://localhost/ and https://tauri.localhost/ on production).
source

pub fn set_center(&mut self, center: bool) -> &mut Self

Show window in the center of the screen.

source

pub fn set_position(&mut self, position: PhysicalPosition) -> &mut Self

The initial position.

source

pub fn set_size(&mut self, size: PhysicalSize) -> &mut Self

The initial size.

source

pub fn set_min_size(&mut self, min_size: PhysicalSize) -> &mut Self

Minimum window size.

source

pub fn set_max_size(&mut self, max_size: PhysicalSize) -> &mut Self

Maximum window size.

source

pub fn set_resizable(&mut self, resizable: bool) -> &mut Self

Whether the window is resizable or not.

source

pub fn set_title(&mut self, title: &'a str) -> &mut Self

Window title.

source

pub fn set_fullscreen(&mut self, fullscreen: bool) -> &mut Self

Whether the window is in fullscreen mode or not.

source

pub fn set_focus(&mut self, focus: bool) -> &mut Self

Whether the window will be initially focused or not.

source

pub fn set_transparent(&mut self, transparent: bool) -> &mut Self

Whether the window is transparent or not.

Note that on macOS this requires the macos-private-api feature flag, enabled under tauri.conf.json > tauri > macOSPrivateApi. WARNING: Using private APIs on macOS prevents your application from being accepted to the App Store.

source

pub fn set_maximized(&mut self, maximized: bool) -> &mut Self

Whether the window should be maximized upon creation or not.

source

pub fn set_visible(&mut self, visible: bool) -> &mut Self

Whether the window should be immediately visible upon creation or not.

source

pub fn set_decorations(&mut self, decorations: bool) -> &mut Self

Whether the window should have borders and bars or not.

source

pub fn set_always_on_top(&mut self, always_on_top: bool) -> &mut Self

Whether the window should always be on top of other windows or not.

source

pub fn set_skip_taskbar(&mut self, skip_taskbar: bool) -> &mut Self

Whether or not the window icon should be added to the taskbar.

source

pub fn set_file_drop_enabled(&mut self, file_drop_enabled: bool) -> &mut Self

Whether the file drop is enabled or not on the webview. By default it is enabled.

Disabling it is required to use drag and drop on the frontend on Windows.

source

pub fn set_theme(&mut self, theme: Theme) -> &mut Self

The initial window theme. Defaults to the system theme.

Only implemented on Windows and macOS 10.14+.

source

pub fn set_title_bar_style( &mut self, title_bar_style: TitleBarStyle, ) -> &mut Self

The style of the macOS title bar.

source

pub fn set_hidden_title(&mut self, hidden_title: bool) -> &mut Self

If true, sets the window title to be hidden on macOS.

source

pub fn set_accept_first_mouse(&mut self, accept_first_mouse: bool) -> &mut Self

Whether clicking an inactive window also clicks through to the webview.

source

pub fn set_tabbing_identifier( &mut self, tabbing_identifier: &'a str, ) -> &mut Self

Defines the window tabbing identifier on macOS.

Windows with the same tabbing identifier will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled.

source

pub fn set_user_agent(&mut self, user_agent: &'a str) -> &mut Self

The user agent for the webview.

source

pub async fn build(&self) -> Result<WebviewWindow, Error>

Creates a new webview window.

Requires allowlist > window > create to be enabled.

Trait Implementations§

source§

impl<'a> Clone for WebviewWindowBuilder<'a>

source§

fn clone(&self) -> WebviewWindowBuilder<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for WebviewWindowBuilder<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for WebviewWindowBuilder<'a>

source§

fn default() -> WebviewWindowBuilder<'a>

Returns the “default value” for a type. Read more
source§

impl<'a> Serialize for WebviewWindowBuilder<'a>

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.