pub trait Screen<'a, const NODES: usize, const EVENTS: usize, const DIRTY: usize> {
// Required method
fn id(&self) -> ScreenId;
// Provided methods
fn on_mount(
&mut self,
_gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>,
) -> Result<(), GuiError> { ... }
fn on_unmount(
&mut self,
_gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>,
) -> Result<(), GuiError> { ... }
fn on_pause(
&mut self,
_gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>,
) -> Result<(), GuiError> { ... }
fn on_resume(
&mut self,
_gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>,
) -> Result<(), GuiError> { ... }
fn handle_input(
&mut self,
_event: InputEvent,
_gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>,
) -> Result<ScreenCommand, GuiError> { ... }
fn tick(
&mut self,
_dt_ms: u32,
_gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>,
) -> Result<ScreenCommand, GuiError> { ... }
}Required Methods§
Provided Methods§
fn on_mount( &mut self, _gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>, ) -> Result<(), GuiError>
fn on_unmount( &mut self, _gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>, ) -> Result<(), GuiError>
fn on_pause( &mut self, _gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>, ) -> Result<(), GuiError>
fn on_resume( &mut self, _gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>, ) -> Result<(), GuiError>
fn handle_input( &mut self, _event: InputEvent, _gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>, ) -> Result<ScreenCommand, GuiError>
fn tick( &mut self, _dt_ms: u32, _gui: &mut GuiContext<'a, NODES, EVENTS, DIRTY>, ) -> Result<ScreenCommand, GuiError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".