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,
        action_tx: UnboundedSender<Action>,
        config: Arc<Config>,
        theme: Arc<Theme>,
    ) -> Result<()> { ... }
    fn handle_events(&mut self, event: Option<Event>) -> ActionResult { ... }
    fn handle_key_events(&mut self, key: KeyEvent) -> ActionResult { ... }
    fn update(&mut self, action: Action) -> ActionResult { ... }
}

Required Methods§

Source

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

Provided Methods§

Source

fn init( &mut self, action_tx: UnboundedSender<Action>, config: Arc<Config>, theme: Arc<Theme>, ) -> Result<()>

Source

fn handle_events(&mut self, event: Option<Event>) -> ActionResult

Source

fn handle_key_events(&mut self, key: KeyEvent) -> ActionResult

Source

fn update(&mut self, action: Action) -> ActionResult

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§