Skip to main content

WebEngine

Trait WebEngine 

Source
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§

Source

fn open(&mut self, url: &str) -> Result<()>

Go to url.

Source

fn resize(&mut self, columns: u16, rows: u16) -> Result<()>

The page’s area is now columns x rows cells.

Source

fn input(&mut self, input: WebInput) -> Result<()>

Source

fn back(&mut self) -> Result<()>

Source

fn forward(&mut self) -> Result<()>

Source

fn reload(&mut self) -> Result<()>

Source

fn poll(&mut self) -> Option<WebFrame>

The newest frame since the last call, if there is one.

Source

fn state(&self) -> PageState

Where the page is and what it is doing now.

Source

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".

Implementors§