pub trait WebViewDelegate: Send + Sync {
// Required methods
fn on_page_started(&self);
fn on_page_finished(&self);
fn handle_post_message(&self, msg: String);
fn log(&self, level: LogLevel, message: &str);
// Provided method
fn on_load_error(&self, _error: &LoadError) { ... }
}Expand description
WebView delegate trait - focused on WebView events only
Required Methods§
Sourcefn on_page_started(&self)
fn on_page_started(&self)
Called when the page starts loading
Sourcefn on_page_finished(&self)
fn on_page_finished(&self)
Called when the page finishes loading
Sourcefn handle_post_message(&self, msg: String)
fn handle_post_message(&self, msg: String)
Handles a postMessage from the page View(WebView)
Provided Methods§
Sourcefn on_load_error(&self, _error: &LoadError)
fn on_load_error(&self, _error: &LoadError)
Called when a main-frame page load fails (e.g. DNS failure, network unreachable, TLS error).
Only fires for the main document; sub-resource errors are ignored. Default is a no-op so existing implementations do not need to change.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".