Struct tauri_runtime::window::PendingWindow
source · pub struct PendingWindow<T: UserEvent, R: Runtime<T>> {
pub label: String,
pub window_builder: <R::Dispatcher as Dispatch<T>>::WindowBuilder,
pub webview_attributes: WebviewAttributes,
pub uri_scheme_protocols: HashMap<String, Box<dyn Fn(&Request) -> Result<Response, Box<dyn Error>> + Send + Sync + 'static>>,
pub http_scheme: bool,
pub ipc_handler: Option<WebviewIpcHandler<T, R>>,
pub menu_ids: Arc<Mutex<HashMap<MenuHash, MenuId>>>,
pub js_event_listeners: Arc<Mutex<HashMap<JsEventListenerKey, HashSet<u32>>>>,
pub navigation_handler: Option<Box<dyn Fn(Url) -> bool + Send>>,
pub web_resource_request_handler: Option<Box<dyn Fn(&Request, &mut Response) + Send + Sync>>,
pub url: String,
}
Expand description
A webview window that has yet to be built.
Fields§
§label: String
The label that the window will be named.
window_builder: <R::Dispatcher as Dispatch<T>>::WindowBuilder
The WindowBuilder
that the window will be created with.
webview_attributes: WebviewAttributes
The WebviewAttributes
that the webview will be created with.
uri_scheme_protocols: HashMap<String, Box<dyn Fn(&Request) -> Result<Response, Box<dyn Error>> + Send + Sync + 'static>>
§http_scheme: bool
§ipc_handler: Option<WebviewIpcHandler<T, R>>
How to handle IPC calls on the webview window.
Maps runtime id to a string menu id.
js_event_listeners: Arc<Mutex<HashMap<JsEventListenerKey, HashSet<u32>>>>
A HashMap mapping JS event names with associated listener ids.
A handler to decide if incoming url is allowed to navigate.
web_resource_request_handler: Option<Box<dyn Fn(&Request, &mut Response) + Send + Sync>>
§url: String
The resolved URL to load on the webview.
Implementations§
source§impl<T: UserEvent, R: Runtime<T>> PendingWindow<T, R>
impl<T: UserEvent, R: Runtime<T>> PendingWindow<T, R>
sourcepub fn new(
window_builder: <R::Dispatcher as Dispatch<T>>::WindowBuilder,
webview_attributes: WebviewAttributes,
label: impl Into<String>,
) -> Result<Self>
pub fn new( window_builder: <R::Dispatcher as Dispatch<T>>::WindowBuilder, webview_attributes: WebviewAttributes, label: impl Into<String>, ) -> Result<Self>
Create a new PendingWindow
with a label and starting url.
sourcepub fn with_config(
window_config: WindowConfig,
webview_attributes: WebviewAttributes,
label: impl Into<String>,
) -> Result<Self>
pub fn with_config( window_config: WindowConfig, webview_attributes: WebviewAttributes, label: impl Into<String>, ) -> Result<Self>
Create a new PendingWindow
from a WindowConfig
with a label and starting url.
pub fn register_uri_scheme_protocol<N: Into<String>, H: Fn(&HttpRequest) -> Result<HttpResponse, Box<dyn Error>> + Send + Sync + 'static>( &mut self, uri_scheme: N, protocol: H, )
Auto Trait Implementations§
impl<T, R> Freeze for PendingWindow<T, R>
impl<T, R> !RefUnwindSafe for PendingWindow<T, R>
impl<T, R> Send for PendingWindow<T, R>
impl<T, R> !Sync for PendingWindow<T, R>
impl<T, R> Unpin for PendingWindow<T, R>
impl<T, R> !UnwindSafe for PendingWindow<T, R>
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