Skip to main content

BrowserWebViewBuilder

Struct BrowserWebViewBuilder 

Source
pub struct BrowserWebViewBuilder { /* private fields */ }

Implementations§

Source§

impl BrowserWebViewBuilder

Source

pub fn delegate(self, delegate: Arc<dyn WebViewDelegate>) -> Self

Bind a WebViewDelegate during creation.

This is the only supported way to configure delegate callbacks.

Source

pub fn on_scheme<F, Fut>(self, scheme: &str, handler: F) -> Self
where F: Fn(Request<Vec<u8>>) -> Fut + Send + Sync + 'static, Fut: Future<Output = SchemeOutcome> + Send + 'static,

Source

pub fn on_navigation<F>(self, handler: F) -> Self
where F: Fn(&str) -> NavigationPolicy + Send + Sync + 'static,

Source

pub fn on_new_window<F>(self, handler: F) -> Self
where F: Fn(&str) -> NewWindowPolicy + Send + Sync + 'static,

Source

pub fn on_download<F>(self, handler: F) -> Self
where F: Fn(DownloadRequest) + Send + Sync + 'static,

Register a download callback (browser profile only).

The callback runs on the platform callback thread; keep it fast and offload expensive work to your app runtime.

Source

pub fn on_file_chooser<F, Fut>(self, handler: F) -> Self
where F: Fn(FileChooserRequest) -> Fut + Send + Sync + 'static, Fut: Future<Output = FileChooserResponse> + Send + 'static,

Source

pub fn create(self) -> WebViewSession

Create a browser-profile WebView session.

Re-creating with the same webtag follows strict rules:

  • Different options => creation fails.
  • Same options but new callback registrations => creation fails.
  • Same options and no callbacks => existing instance is reused.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.