Skip to main content

Component

Trait Component 

Source
pub trait Component {
    // Required method
    fn render(&mut self, f: &mut Frame<'_>, area: Rect);

    // Provided methods
    fn init(&mut self) -> Result<()> { ... }
    fn handle_action(&mut self, action: &Action) -> Option<Action> { ... }
}
Expand description

Component trait for UI elements

Required Methods§

Source

fn render(&mut self, f: &mut Frame<'_>, area: Rect)

Render the component

Provided Methods§

Source

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

Initialize the component

Source

fn handle_action(&mut self, action: &Action) -> Option<Action>

Handle an action and optionally return a new action

Implementors§