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§