mecomp_tui::ui::components

Trait Component

source
pub trait Component {
    // Required methods
    fn new(state: &AppState, action_tx: UnboundedSender<Action>) -> Self
       where Self: Sized;
    fn move_with_state(self, state: &AppState) -> Self
       where Self: Sized;
    fn name(&self) -> &str;
    fn handle_key_event(&mut self, key: KeyEvent);
    fn handle_mouse_event(&mut self, _mouse: MouseEvent, _area: Rect);
}

Required Methods§

source

fn new(state: &AppState, action_tx: UnboundedSender<Action>) -> Self
where Self: Sized,

source

fn move_with_state(self, state: &AppState) -> Self
where Self: Sized,

source

fn name(&self) -> &str

source

fn handle_key_event(&mut self, key: KeyEvent)

source

fn handle_mouse_event(&mut self, _mouse: MouseEvent, _area: Rect)

Implementors§