pub trait Dialog {
// Required methods
fn key(&mut self, key: KeyEvent, tx: &AppTx) -> EventState;
fn mouse(&mut self, m: &MouseEvent, tx: &AppTx) -> EventState;
fn draw(&mut self, f: &mut Frame<'_>, rect: Rect, theme: &Theme);
// Provided method
fn set_error(&mut self, _msg: String) { ... }
}Expand description
What ActiveDialog needs from each dialog, so its dispatch is one inner()
match instead of one match per method. A modal consumes every mouse event
(a click must never reach the panels behind it); the impls live next to
each dialog.
Required Methods§
fn key(&mut self, key: KeyEvent, tx: &AppTx) -> EventState
fn mouse(&mut self, m: &MouseEvent, tx: &AppTx) -> EventState
fn draw(&mut self, f: &mut Frame<'_>, rect: Rect, theme: &Theme)
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".