pub trait Overlay {
// Required methods
fn handle_key(&mut self, key: KeyEvent) -> OverlayOutcome;
fn render(&self, width: u16, height: u16) -> OverlayFrame;
fn title(&self) -> Cow<'_, str>;
// Provided methods
fn handle_mouse(
&mut self,
_ev: MouseEvent,
_body_rows: u16,
) -> OverlayOutcome { ... }
fn refresh(&mut self, _ctx: OverlayContext<'_>) { ... }
}Required Methods§
fn handle_key(&mut self, key: KeyEvent) -> OverlayOutcome
Sourcefn render(&self, width: u16, height: u16) -> OverlayFrame
fn render(&self, width: u16, height: u16) -> OverlayFrame
Render against a (width, height) viewport. Height includes the status row.
fn title(&self) -> Cow<'_, str>
Provided Methods§
fn handle_mouse(&mut self, _ev: MouseEvent, _body_rows: u16) -> OverlayOutcome
Sourcefn refresh(&mut self, _ctx: OverlayContext<'_>)
fn refresh(&mut self, _ctx: OverlayContext<'_>)
Called after Apply(cmd) dispatches, so the overlay can re-derive
state (e.g. picker rebuilds visible after a DropFileAt).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".