Trait App

Source
pub trait App: Sized {
    const UPDATES_PER_SECOND: u32;
    const RENDERS_PER_SECOND: u32;

    // Required methods
    fn update(&mut self, dt: Duration);
    fn render(&mut self, dt: Duration);
    fn window_event(&mut self, event: WindowEvent) -> ControlFlow;
    fn device_event(&mut self, event: DeviceEvent) -> ControlFlow;
}

Required Associated Constants§

Required Methods§

Source

fn update(&mut self, dt: Duration)

Source

fn render(&mut self, dt: Duration)

Source

fn window_event(&mut self, event: WindowEvent) -> ControlFlow

Source

fn device_event(&mut self, event: DeviceEvent) -> ControlFlow

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§