pub trait MenuScreen: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn render(&self, ctx: &MenuRenderCtx, buf: &mut MenuBuffer);
fn handle_input(&mut self, input: &InputEvent) -> MenuAction;
// Provided methods
fn on_push(&mut self) { ... }
fn on_pop(&mut self) { ... }
fn tooltip(&self) -> Option<&str> { ... }
fn update(&mut self, _dt: f32) { ... }
}Required Methods§
fn name(&self) -> &str
fn render(&self, ctx: &MenuRenderCtx, buf: &mut MenuBuffer)
fn handle_input(&mut self, input: &InputEvent) -> MenuAction
Provided Methods§
fn on_push(&mut self)
fn on_pop(&mut self)
fn tooltip(&self) -> Option<&str>
fn update(&mut self, _dt: f32)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".