pub trait Component {
// Required method
fn render(
&mut self,
f: &mut Frame<'_>,
rect: Rect,
theme: &Theme,
focused: bool,
);
// Provided methods
fn handle_input(&mut self, event: &InputEvent, tx: &AppTx) -> EventState { ... }
fn hint_shortcuts(&self) -> Vec<(String, String)> { ... }
}Required Methods§
Provided Methods§
Sourcefn handle_input(&mut self, event: &InputEvent, tx: &AppTx) -> EventState
fn handle_input(&mut self, event: &InputEvent, tx: &AppTx) -> EventState
Handle an event. Send AppEvents through tx for app-level effects.
Returns whether this component consumed the event.
Sourcefn hint_shortcuts(&self) -> Vec<(String, String)>
fn hint_shortcuts(&self) -> Vec<(String, String)>
Context-sensitive shortcut hints shown in the hints bar when this
component is focused. Each entry is (key_display, label).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".