pub struct Web { /* private fields */ }Implementations§
Source§impl Web
impl Web
pub fn new(web_tag: String) -> Self
pub fn on_controller_attach<F>(&self, callback: F) -> Result<(), ArkWebError>where
F: FnMut(),
pub fn on_page_begin<F>(&self, callback: F) -> Result<(), ArkWebError>where
F: FnMut(),
pub fn on_page_end<F>(&self, callback: F) -> Result<(), ArkWebError>where
F: FnMut(),
pub fn on_destroy<F>(&self, callback: F) -> Result<(), ArkWebError>where
F: FnMut(),
Sourcepub fn run_javascript<F>(
&self,
js_code: &str,
callback: F,
) -> Result<(), ArkWebError>
pub fn run_javascript<F>( &self, js_code: &str, callback: F, ) -> Result<(), ArkWebError>
Evaluates js_code in the page currently displayed by this Web component
and invokes callback once with the result bytes (None if ArkWeb supplies
no bridge payload). ArkWeb may invoke callback on an internal worker thread.
Sourcepub fn custom_protocol<S>(
&self,
protocol: S,
handle: CustomProtocolHandler,
) -> Result<bool, ArkWebError>
pub fn custom_protocol<S>( &self, protocol: S, handle: CustomProtocolHandler, ) -> Result<bool, ArkWebError>
Register a custom protocol handler for the web view.
§Arguments
protocol- The protocol to register the handler for.handle- The handler to register.
ⓘ
let web = Web::new("web_tag".to_string());
let handler = CustomProtocolHandler::new();
handler.on_request_start(|request, handle| {
handle.receive_data("Hello, world!");
true
});
handler.on_request_stop(|request| {
println!("Request stopped: {:?}", request);
});
web.custom_protocol("custom", handler).unwrap();Trait Implementations§
Auto Trait Implementations§
impl Forget for Web
impl Freeze for Web
impl Move for Web
impl RefUnwindSafe for Web
impl Send for Webwhere
RawVecInner: Send,
impl Sync for Webwhere
RawVecInner: Sync,
impl Unpin for Web
impl UnsafeUnpin for Web
impl UnwindSafe for Webwhere
RawVecInner: UnwindSafe,
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