pub trait Overlay {
type A: ActionExt;
// Required methods
fn handle_input(&mut self, c: char) -> OverlayEffect;
fn draw(&mut self, frame: &mut Frame<'_>, area: Rect);
// Provided methods
fn on_enable(&mut self, area: &Rect) { ... }
fn on_disable(&mut self) { ... }
fn handle_action(&mut self, action: &Action<Self::A>) -> OverlayEffect { ... }
fn area(&mut self, ui_area: &Rect) -> Result<Rect, [u16; 2]> { ... }
}Required Associated Types§
Required Methods§
fn handle_input(&mut self, c: char) -> OverlayEffect
Provided Methods§
fn on_enable(&mut self, area: &Rect)
fn on_disable(&mut self)
fn handle_action(&mut self, action: &Action<Self::A>) -> OverlayEffect
Sourcefn area(&mut self, ui_area: &Rect) -> Result<Rect, [u16; 2]>
fn area(&mut self, ui_area: &Rect) -> Result<Rect, [u16; 2]>
Called when layout area changes. The output of this is processed and cached into the area which the draw method is called with.
§Notes
Return None or Err([0, 0]) to draw in the default area (see OverlayConfig and default_area)