pub struct ProtocolHandler { /* private fields */ }Expand description
Protocol handler for one webview session.
This struct is not Send because it holds main-thread webview state.
Implementations§
Source§impl ProtocolHandler
impl ProtocolHandler
Sourcepub fn handle_request<R>(
&self,
protocol: &str,
request: &Request<Vec<u8>>,
responder: R,
) -> Option<R>
pub fn handle_request<R>( &self, protocol: &str, request: &Request<Vec<u8>>, responder: R, ) -> Option<R>
Create a protocol handler closure suitable for WebViewBuilder::with_asynchronous_custom_protocol.
The returned closure handles this subset of “{protocol}://” requests:
- “/wbg/preinitialized” - enables startup calls before the app lock
- “/wbg/initialized” - signals webview loaded
- “/wbg/snippets/{path}” - serves inline JS modules
- “/wbg/init.js” - serves the initialization script
- “/wbg/handler” - main IPC endpoint
§Arguments
protocol- The protocol scheme (e.g., “wry”)
Auto Trait Implementations§
impl !RefUnwindSafe for ProtocolHandler
impl !Send for ProtocolHandler
impl !Sync for ProtocolHandler
impl !UnwindSafe for ProtocolHandler
impl Freeze for ProtocolHandler
impl Unpin for ProtocolHandler
impl UnsafeUnpin for ProtocolHandler
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