pub struct CustomProtocolHandler { /* private fields */ }Expand description
A custom protocol handler for the web view.
ⓘ
let handler = CustomProtocolHandler::new();
handler.on_request_start(|request, handle| {
handle.receive_data("Hello, world!");
true
});Implementations§
Source§impl CustomProtocolHandler
impl CustomProtocolHandler
pub fn new() -> Self
pub fn raw(&self) -> *mut ArkWeb_SchemeHandler
Sourcepub fn on_request_start<F>(&self, handler: F)
pub fn on_request_start<F>(&self, handler: F)
Set the callback for the request start event.
§Arguments
handler- The callback to set.
§Return
trueif the request should be intercepted,falseotherwise.
§Example
ⓘ
let handler = CustomProtocolHandler::new();
handler.on_request_start(|request, handle| {
handle.receive_data("Hello, world!");
true
});Sourcepub fn on_request_stop<F>(&self, handler: F)where
F: FnMut(ResourceRequest),
pub fn on_request_stop<F>(&self, handler: F)where
F: FnMut(ResourceRequest),
Set the callback for the request stop event.
Trait Implementations§
Source§impl Default for CustomProtocolHandler
impl Default for CustomProtocolHandler
Source§impl Drop for CustomProtocolHandler
impl Drop for CustomProtocolHandler
Auto Trait Implementations§
impl !Send for CustomProtocolHandler
impl !Sync for CustomProtocolHandler
impl Forget for CustomProtocolHandler
impl Freeze for CustomProtocolHandler
impl Move for CustomProtocolHandler
impl RefUnwindSafe for CustomProtocolHandler
impl Unpin for CustomProtocolHandler
impl UnsafeUnpin for CustomProtocolHandler
impl UnwindSafe for CustomProtocolHandler
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