pub trait App: Sized + 'static {
// Required methods
fn new(core: &mut Core) -> Self;
fn on_event(&mut self, core: &mut Core, event: &WindowEvent) -> bool;
// Provided methods
fn name() -> &'static str { ... }
fn size() -> LogicalSize<u32> { ... }
fn backends() -> Backends { ... }
fn on_device_event(&mut self, core: &mut Core, event: &DeviceEvent) { ... }
fn update(&mut self, core: &mut Core, dt: f32) { ... }
fn ui(&mut self, core: &mut Core, ctx: &Context) { ... }
}Required Methods§
fn new(core: &mut Core) -> Self
Sourcefn on_event(&mut self, core: &mut Core, event: &WindowEvent) -> bool
fn on_event(&mut self, core: &mut Core, event: &WindowEvent) -> bool
Return true to consume event
Provided Methods§
fn name() -> &'static str
fn size() -> LogicalSize<u32>
fn backends() -> Backends
fn on_device_event(&mut self, core: &mut Core, event: &DeviceEvent)
fn update(&mut self, core: &mut Core, dt: f32)
fn ui(&mut self, core: &mut Core, ctx: &Context)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.