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: StringThe label that the webview will be named.
webview_attributes: WebviewAttributesThe 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::RuntimeWebviewAttributesThe 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.
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: StringThe 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>
impl<T: UserEvent, R: Runtime<T>> PendingWebview<T, R>
Sourcepub fn new(
webview_attributes: WebviewAttributes,
runtime_specific_attributes: R::RuntimeWebviewAttributes,
label: impl Into<String>,
) -> Result<Self>
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.
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§
impl<T, R> !RefUnwindSafe for PendingWebview<T, R>
impl<T, R> !Sync for PendingWebview<T, R>
impl<T, R> !UnwindSafe for PendingWebview<T, R>
impl<T, R> Freeze for PendingWebview<T, R>where
Option<<R as Runtime<T>>::WindowOpener>: Freeze,
<R as Runtime<T>>::RuntimeWebviewAttributes: Freeze,
Option<Box<dyn Fn(DetachedWebview<T, R>, Request<String>) + Send>>: Freeze,
Option<Box<dyn Fn(Url, NewWindowFeatures<T, R>) -> NewWindowResponse + Sync + Send>>: Freeze,
impl<T, R> Send for PendingWebview<T, R>where
Option<<R as Runtime<T>>::WindowOpener>: Send,
<R as Runtime<T>>::RuntimeWebviewAttributes: Send,
Option<Box<dyn Fn(DetachedWebview<T, R>, Request<String>) + Send>>: Send,
Option<Box<dyn Fn(Url, NewWindowFeatures<T, R>) -> NewWindowResponse + Sync + Send>>: Send,
impl<T, R> Unpin for PendingWebview<T, R>where
Option<<R as Runtime<T>>::WindowOpener>: Unpin,
<R as Runtime<T>>::RuntimeWebviewAttributes: Unpin,
Option<Box<dyn Fn(DetachedWebview<T, R>, Request<String>) + Send>>: Unpin,
Option<Box<dyn Fn(Url, NewWindowFeatures<T, R>) -> NewWindowResponse + Sync + Send>>: Unpin,
impl<T, R> UnsafeUnpin for PendingWebview<T, R>where
Option<<R as Runtime<T>>::WindowOpener>: UnsafeUnpin,
<R as Runtime<T>>::RuntimeWebviewAttributes: UnsafeUnpin,
Option<Box<dyn Fn(DetachedWebview<T, R>, Request<String>) + Send>>: UnsafeUnpin,
Option<Box<dyn Fn(Url, NewWindowFeatures<T, R>) -> NewWindowResponse + Sync + Send>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more