Skip to main content

PendingWebview

Struct PendingWebview 

Source
pub struct PendingWebview<T: UserEvent, R: Runtime<T>> {
Show 15 fields pub label: String, pub webview_attributes: WebviewAttributes, pub opener: Option<R::WindowOpener>, pub runtime_specific_attributes: R::RuntimeWebviewAttributes, pub uri_scheme_protocols: HashMap<String, Box<UriSchemeProtocolHandler>>, pub ipc_handler: Option<WebviewIpcHandler<T, R>>, pub navigation_handler: Option<Box<NavigationHandler>>, pub new_window_handler: Option<Box<NewWindowHandler<T, R>>>, pub document_title_changed_handler: Option<Box<DocumentTitleChangedHandler>>, pub url: String, pub web_resource_request_handler: Option<Box<WebResourceRequestHandler>>, pub on_page_load_handler: Option<Box<OnPageLoadHandler>>, pub download_handler: Option<Arc<DownloadHandler>>, pub permission_request_handler: Option<Box<dyn Fn(PermissionKind) -> PermissionResponse + Send + Sync>>, pub on_web_content_process_terminate_handler: Option<Box<OnWebContentProcessTerminateHandler>>,
}
Expand description

A webview that has yet to be built.

Fields§

§label: String

The label that the webview will be named.

§webview_attributes: WebviewAttributes

The WebviewAttributes that the webview will be created with.

§opener: Option<R::WindowOpener>

Information about the webview that initiated a new window request.

§runtime_specific_attributes: R::RuntimeWebviewAttributes

The runtime-specific webview attributes, see Runtime::RuntimeWebviewAttributes.

§uri_scheme_protocols: HashMap<String, Box<UriSchemeProtocolHandler>>

Custom protocols to register on the webview

§ipc_handler: Option<WebviewIpcHandler<T, R>>

How to handle IPC calls on the webview.

§navigation_handler: Option<Box<NavigationHandler>>

A handler to decide if incoming url is allowed to navigate.

§new_window_handler: Option<Box<NewWindowHandler<T, R>>>§document_title_changed_handler: Option<Box<DocumentTitleChangedHandler>>§url: String

The resolved URL to load on the webview.

§web_resource_request_handler: Option<Box<WebResourceRequestHandler>>§on_page_load_handler: Option<Box<OnPageLoadHandler>>§download_handler: Option<Arc<DownloadHandler>>§permission_request_handler: Option<Box<dyn Fn(PermissionKind) -> PermissionResponse + Send + Sync>>§on_web_content_process_terminate_handler: Option<Box<OnWebContentProcessTerminateHandler>>

Implementations§

Source§

impl<T: UserEvent, R: Runtime<T>> PendingWebview<T, R>

Source

pub fn new( webview_attributes: WebviewAttributes, runtime_specific_attributes: R::RuntimeWebviewAttributes, label: impl Into<String>, ) -> Result<Self>

Create a new PendingWebview with a label from the given WebviewAttributes.

Source

pub fn register_uri_scheme_protocol<N: Into<String>, H: Fn(&str, Request<Vec<u8>>, Box<dyn FnOnce(Response<Cow<'static, [u8]>>) + Send>) + Send + Sync + 'static>( &mut self, uri_scheme: N, protocol_handler: H, )

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.