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(&HttpRequest) -> Result<HttpResponse, Box<dyn Error>> + Send + Sync + 'static>>,
pub ipc_handler: Option<WebviewIpcHandler<T, 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<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(&HttpRequest) -> Result<HttpResponse, Box<dyn Error>> + Send + Sync + 'static>>
ipc_handler: Option<WebviewIpcHandler<T, R>>
How to handle IPC calls on 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<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> !RefUnwindSafe for PendingWindow<T, R>
impl<T, R> Send for PendingWindow<T, R>where
<<R as Runtime<T>>::Dispatcher as Dispatch<T>>::WindowBuilder: Send,
impl<T, R> !Sync for PendingWindow<T, R>
impl<T, R> Unpin for PendingWindow<T, R>where
<<R as Runtime<T>>::Dispatcher as Dispatch<T>>::WindowBuilder: Unpin,
impl<T, R> !UnwindSafe for PendingWindow<T, R>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more