pub trait Component: Send {
// Required methods
fn measure(&mut self, width: u16) -> u16;
fn render(&mut self, area: Rect, buf: &mut Buffer);
fn handle_event(&mut self, event: &UiEvent) -> EventResult;
fn invalidate(&mut self);
}Expand description
Re-export of the pi-tui component contract for downstream callers. Height-for-width terminal component.
render must emit exactly the number of rows previously returned by
Component::measure for the same width.
Required Methods§
Sourcefn handle_event(&mut self, event: &UiEvent) -> EventResult
fn handle_event(&mut self, event: &UiEvent) -> EventResult
Handle an input event.
Sourcefn invalidate(&mut self)
fn invalidate(&mut self)
Drop width/theme-sensitive caches after resize or theme change.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".