Skip to main content

App

Trait App 

Source
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§

Source

fn new(core: &mut Core) -> Self

Source

fn on_event(&mut self, core: &mut Core, event: &WindowEvent) -> bool

Return true to consume event

Provided Methods§

Source

fn name() -> &'static str

Source

fn size() -> LogicalSize<u32>

Source

fn backends() -> Backends

Source

fn on_device_event(&mut self, core: &mut Core, event: &DeviceEvent)

Source

fn update(&mut self, core: &mut Core, dt: f32)

Source

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.

Implementors§