pub trait Screen {
type Error: From<Error>;
// Required methods
fn render(&self, frame: &mut Frame<'_>);
fn handle_key(
&mut self,
key: KeyEvent,
tui: &mut Tui,
) -> Result<Flow, Self::Error>;
// Provided method
fn tick(&mut self) { ... }
}Expand description
A full-screen UI that run can drive.
render is &self so it can be reused as the background of a modal while
the handler holds &mut Tui. The associated Error keeps this kit free of
any concrete error crate; it only needs to absorb I/O errors.
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".