Struct tauri_runtime::window::PendingWindow
source · [−]pub struct PendingWindow<R: Runtime> {
pub label: String,
pub window_builder: <R::Dispatcher as Dispatch>::WindowBuilder,
pub webview_attributes: WebviewAttributes,
pub uri_scheme_protocols: HashMap<String, Box<dyn Fn(&HttpRequest) -> Result<HttpResponse, Box<dyn Error>> + Send + Sync + 'static>>,
pub ipc_handler: Option<WebviewIpcHandler<R>>,
pub file_drop_handler: Option<FileDropHandler<R>>,
pub url: String,
pub menu_ids: Arc<Mutex<HashMap<MenuHash, MenuId>>>,
pub js_event_listeners: Arc<Mutex<HashMap<JsEventListenerKey, HashSet<u64>>>>,
}
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>::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(&HttpRequest) -> Result<HttpResponse, Box<dyn Error>> + Send + Sync + 'static>>
ipc_handler: Option<WebviewIpcHandler<R>>
How to handle IPC calls on the webview window.
file_drop_handler: Option<FileDropHandler<R>>
How to handle a file dropping onto the webview window.
url: String
The resolved URL to load on the webview.
Maps runtime id to a string menu id.
js_event_listeners: Arc<Mutex<HashMap<JsEventListenerKey, HashSet<u64>>>>
A HashMap mapping JS event names with associated listener ids.
Implementations
sourceimpl<R: Runtime> PendingWindow<R>
impl<R: Runtime> PendingWindow<R>
sourcepub fn new(
window_builder: <R::Dispatcher as Dispatch>::WindowBuilder,
webview_attributes: WebviewAttributes,
label: impl Into<String>
) -> Self
pub fn new(
window_builder: <R::Dispatcher as Dispatch>::WindowBuilder,
webview_attributes: WebviewAttributes,
label: impl Into<String>
) -> 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>
) -> Self
pub fn with_config(
window_config: WindowConfig,
webview_attributes: WebviewAttributes,
label: impl Into<String>
) -> 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<R> !RefUnwindSafe for PendingWindow<R>
impl<R> Send for PendingWindow<R> where
<<R as Runtime>::Dispatcher as Dispatch>::WindowBuilder: Send,
impl<R> !Sync for PendingWindow<R>
impl<R> Unpin for PendingWindow<R> where
<<R as Runtime>::Dispatcher as Dispatch>::WindowBuilder: Unpin,
impl<R> !UnwindSafe for PendingWindow<R>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more