pub struct WebView { /* private fields */ }Expand description
A web view that can be used to load web content.
This web view won’t be displayed to the user. It is intended for use in the background.
Implementations§
Source§impl WebView
impl WebView
Sourcepub fn set_rule_list(&self, json: &str) -> Result<(), JsError>
pub fn set_rule_list(&self, json: &str) -> Result<(), JsError>
Sets a content rule list for the web view.
For information on formatting the rule list json, see Apple’s documentation on Creating a content blocker.
Sourcepub fn load_blocking(&self, request: Request) -> Result<(), JsError>
pub fn load_blocking(&self, request: Request) -> Result<(), JsError>
Loads a web page in the web view, blocking until the page is loaded.
Sourcepub fn load_html(
&self,
html: &str,
base_url: Option<&str>,
) -> Result<(), JsError>
pub fn load_html( &self, html: &str, base_url: Option<&str>, ) -> Result<(), JsError>
Loads the given HTML content in the web view.
Sourcepub fn load_html_blocking(
&self,
html: &str,
base_url: Option<&str>,
) -> Result<(), JsError>
pub fn load_html_blocking( &self, html: &str, base_url: Option<&str>, ) -> Result<(), JsError>
Loads HTML content in the web view, blocking until the content is loaded.
Sourcepub fn wait_for_load(&self)
pub fn wait_for_load(&self)
Blocks the current thread until the web view is loaded.
Sourcepub fn eval(&self, js: &str) -> Result<String, JsError>
pub fn eval(&self, js: &str) -> Result<String, JsError>
Evaluates JavaScript code in the web view, blocking until the result is available.
Sourcepub fn eval_async(&self, js: &str) -> Result<String, JsError>
pub fn eval_async(&self, js: &str) -> Result<String, JsError>
Evaluates asynchronous JavaScript code in the web view, blocking until the result is available.
Sourcepub fn add_user_script(&self, script: WebViewUserScript) -> Result<(), JsError>
pub fn add_user_script(&self, script: WebViewUserScript) -> Result<(), JsError>
Adds a user script to the web view.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebView
impl RefUnwindSafe for WebView
impl Send for WebView
impl Sync for WebView
impl Unpin for WebView
impl UnsafeUnpin for WebView
impl UnwindSafe for WebView
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