Skip to main content

TerminalApp

Trait TerminalApp 

Source
pub trait TerminalApp {
    type Command: From<KeyPress>;

    // Required methods
    fn render(&self, frame: &mut Frame<'_>);
    fn handle_input(&mut self, cmd: Self::Command) -> bool;
    fn tick(&mut self, delta_ms: u64) -> bool;
    fn should_quit(&self) -> bool;

    // Provided method
    fn input_extensions(&self) -> Vec<OscHandler<Self::Command>> ⓘ { ... }
}
Expand description

The trait that application authors implement.

Required Associated Types§

Source

type Command: From<KeyPress>

App-specific command type. Must accept framework KeyPress via From.

Required Methods§

Source

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

Render the current frame.

Source

fn handle_input(&mut self, cmd: Self::Command) -> bool

Handle a parsed input command. Return true if display needs redrawing.

Source

fn tick(&mut self, delta_ms: u64) -> bool

Advance state by delta_ms. Return true if redraw needed.

Source

fn should_quit(&self) -> bool

Whether the application should exit.

Provided Methods§

Source

fn input_extensions(&self) -> Vec<OscHandler<Self::Command>> ⓘ

Override to register custom OSC input handlers.

Implementors§