pub trait App {
// Required methods
fn render(
&mut self,
painter: &mut Painter,
builder: &mut Builder<'_>,
info: &Info<'_>,
);
fn event(&mut self, event: &WindowEvent<'_>) -> EventResult;
fn update(&mut self, builder: &mut Builder<'_>, info: &Info<'_>);
// Provided methods
fn init(&mut self, _builder: &mut Builder<'_>) { ... }
fn run(self, settings: RunSettings)
where Self: Sized + 'static { ... }
fn run_with_event_loop(
self,
event_loop: EventLoop<()>,
settings: RunSettings,
)
where Self: Sized + 'static { ... }
}Expand description
Main Application trait
handles rendering, inputs and updates
Required Methods§
Sourcefn render(
&mut self,
painter: &mut Painter,
builder: &mut Builder<'_>,
info: &Info<'_>,
)
fn render( &mut self, painter: &mut Painter, builder: &mut Builder<'_>, info: &Info<'_>, )
Handle Rendering
Sourcefn event(&mut self, event: &WindowEvent<'_>) -> EventResult
fn event(&mut self, event: &WindowEvent<'_>) -> EventResult
Handle Events
return true if the event was handled
Provided Methods§
Sourcefn run(self, settings: RunSettings)where
Self: Sized + 'static,
fn run(self, settings: RunSettings)where
Self: Sized + 'static,
Runs the App
continuous: draw continuously or after an event title: the title of the window
Sourcefn run_with_event_loop(self, event_loop: EventLoop<()>, settings: RunSettings)where
Self: Sized + 'static,
fn run_with_event_loop(self, event_loop: EventLoop<()>, settings: RunSettings)where
Self: Sized + 'static,
Runs the App