Skip to main content

Overlay

Trait Overlay 

Source
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§

Source

fn handle_key(&mut self, key: KeyEvent) -> OverlayOutcome

Source

fn render(&self, width: u16, height: u16) -> OverlayFrame

Render against a (width, height) viewport. Height includes the status row.

Source

fn title(&self) -> Cow<'_, str>

Provided Methods§

Source

fn handle_mouse(&mut self, _ev: MouseEvent, _body_rows: u16) -> OverlayOutcome

Source

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".

Implementors§