pub trait WebEngine {
// Required methods
fn open(&mut self, url: &str) -> Result<()>;
fn resize(&mut self, columns: u16, rows: u16) -> Result<()>;
fn input(&mut self, input: WebInput) -> Result<()>;
fn back(&mut self) -> Result<()>;
fn forward(&mut self) -> Result<()>;
fn reload(&mut self) -> Result<()>;
fn poll(&mut self) -> Option<WebFrame>;
fn state(&self) -> PageState;
fn set_notify(&mut self, notify: Notify);
}Expand description
A browser behind a web_view: opens pages, takes input, and hands
back frames. Every method is called on the app’s thread; work that takes
time happens on the engine’s own threads, which call the Notify
when there is a new frame or a new state.
The view calls resize before the first
open, and again whenever the page’s area changes.
Required Methods§
Sourcefn resize(&mut self, columns: u16, rows: u16) -> Result<()>
fn resize(&mut self, columns: u16, rows: u16) -> Result<()>
The page’s area is now columns x rows cells.
fn input(&mut self, input: WebInput) -> Result<()>
fn back(&mut self) -> Result<()>
fn forward(&mut self) -> Result<()>
fn reload(&mut self) -> Result<()>
Sourcefn set_notify(&mut self, notify: Notify)
fn set_notify(&mut self, notify: Notify)
Call notify when there is a new frame or state. Given once.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".