pub trait Application: Sized + 'static {
Show 18 methods
// Required methods
fn new(assets: &mut impl Assets) -> Self;
fn tick(&mut self, assets: &mut impl Assets);
fn render(&mut self, gfx: &mut impl Gfx);
// Provided methods
fn audio(&mut self, _audio: &mut impl Audio) { ... }
fn wants_to_quit(&self) -> bool { ... }
fn wants_cursor_visible(&self) -> bool { ... }
fn keyboard_input(&mut self, _state: ButtonState, _key_code: KeyCode) { ... }
fn cursor_entered(&mut self) { ... }
fn cursor_left(&mut self) { ... }
fn cursor_moved(&mut self, _position: UVec2) { ... }
fn mouse_input(&mut self, _state: ButtonState, _button: MouseButton) { ... }
fn mouse_wheel(&mut self, _delta_y: i16) { ... }
fn mouse_motion(&mut self, _delta: Vec2) { ... }
fn gamepad_activated(&mut self, _gamepad_id: GamePadId, _name: String) { ... }
fn gamepad_button_changed(
&mut self,
_gamepad: &Gamepad,
_button: Button,
_value: Fp,
) { ... }
fn gamepad_axis_changed(
&mut self,
_gamepad: &Gamepad,
_axis: Axis,
_value: Fp,
) { ... }
fn gamepad_disconnected(&mut self, _gamepad_id: GamePadId) { ... }
fn scale_factor_changed(&mut self, _scale_factor: f64) -> Option<UVec2> { ... }
}
Required Methods§
fn new(assets: &mut impl Assets) -> Self
fn tick(&mut self, assets: &mut impl Assets)
fn render(&mut self, gfx: &mut impl Gfx)
Provided Methods§
fn audio(&mut self, _audio: &mut impl Audio)
fn wants_to_quit(&self) -> bool
fn wants_cursor_visible(&self) -> bool
fn keyboard_input(&mut self, _state: ButtonState, _key_code: KeyCode)
fn cursor_entered(&mut self)
fn cursor_left(&mut self)
fn cursor_moved(&mut self, _position: UVec2)
fn mouse_input(&mut self, _state: ButtonState, _button: MouseButton)
fn mouse_wheel(&mut self, _delta_y: i16)
fn mouse_motion(&mut self, _delta: Vec2)
fn gamepad_activated(&mut self, _gamepad_id: GamePadId, _name: String)
fn gamepad_axis_changed(&mut self, _gamepad: &Gamepad, _axis: Axis, _value: Fp)
fn gamepad_disconnected(&mut self, _gamepad_id: GamePadId)
fn scale_factor_changed(&mut self, _scale_factor: f64) -> Option<UVec2>
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.