Skip to main content

Screen

Trait Screen 

Source
pub trait Screen {
    // Required methods
    fn render(&mut self, frame: &mut Frame<'_>);
    fn handle_key(&mut self, key: KeyEvent);
    fn interrupt(&mut self);
    fn done(&self) -> bool;

    // Provided methods
    fn pending_work(&self) -> Option<String> { ... }
    fn do_work(&mut self) { ... }
}
Expand description

A full-screen view driven by run_screen.

Required Methods§

Source

fn render(&mut self, frame: &mut Frame<'_>)

Source

fn handle_key(&mut self, key: KeyEvent)

A key press (Ctrl-C goes to Screen::interrupt instead).

Source

fn interrupt(&mut self)

Source

fn done(&self) -> bool

Provided Methods§

Source

fn pending_work(&self) -> Option<String>

Blocking work the last key asked for, as a line to print while it runs; Screen::do_work then does it.

Source

fn do_work(&mut self)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§