Skip to main content

Struct tauri::WebviewAttributes

pub struct WebviewAttributes {
    pub url: WindowUrl,
    pub initialization_scripts: Vec<String, Global>,
    pub data_directory: Option<PathBuf>,
    pub file_drop_handler_enabled: bool,
}

Expand description

The attributes used to create an webview.

Fields#

url: WindowUrl``initialization_scripts: Vec<String, Global>``data_directory: Option<PathBuf>``file_drop_handler_enabled: bool

Implementations#

impl WebviewAttributes#

pub fn new(url: WindowUrl) -> WebviewAttributes#

Initializes the default attributes for a webview.

pub fn initialization_script(self, script: &str) -> WebviewAttributes#

Sets the init script.

pub fn data_directory(self, data_directory: PathBuf) -> WebviewAttributes#

Data directory for the webview.

pub fn disable_file_drop_handler(self) -> WebviewAttributes#

Disables the file drop handler. This is required to use drag and drop APIs on the front end on Windows.

Trait Implementations#

impl Debug for WebviewAttributes#

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

Formats the value using the given formatter. Read more

Auto Trait Implementations#

impl RefUnwindSafe for WebviewAttributes#

impl Send for WebviewAttributes#

impl Sync for WebviewAttributes#

impl Unpin for WebviewAttributes#

impl UnwindSafe for WebviewAttributes#

Blanket Implementations#

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

pub fn type_id(&self) -> TypeId[src]#

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]#

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mutT[src]#

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]#

Performs the conversion.

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

pub fn into(self) -> U[src]#

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]#

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]#

Performs the conversion.

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

pub fn vzip(self) -> V#