pub trait WindowEventHandler: Send + Sync {
type Host;
// Required methods
fn update(&self, host: &mut Self::Host) -> Result<()>;
fn draw(&self, host: &mut Self::Host) -> Result<()>;
// Provided methods
fn key_down_event(
&self,
_host: &mut Self::Host,
_event: KeyboardEvent,
) -> Result<()> { ... }
fn key_up_event(
&self,
_host: &mut Self::Host,
_event: KeyboardEvent,
) -> Result<()> { ... }
fn mouse_motion_event(
&self,
_host: &mut Self::Host,
_event: MouseMotionEvent,
) -> Result<()> { ... }
fn mouse_button_down_event(
&self,
_host: &mut Self::Host,
_event: MouseClickEvent,
) -> Result<()> { ... }
fn mouse_button_up_event(
&self,
_host: &mut Self::Host,
_event: MouseClickEvent,
) -> Result<()> { ... }
fn mouse_wheel_event(
&self,
_host: &mut Self::Host,
_event: MouseWheelEvent,
) -> Result<()> { ... }
}Required Associated Types§
Required Methods§
fn update(&self, host: &mut Self::Host) -> Result<()>
fn draw(&self, host: &mut Self::Host) -> Result<()>
Provided Methods§
fn key_down_event( &self, _host: &mut Self::Host, _event: KeyboardEvent, ) -> Result<()>
fn key_up_event( &self, _host: &mut Self::Host, _event: KeyboardEvent, ) -> Result<()>
fn mouse_motion_event( &self, _host: &mut Self::Host, _event: MouseMotionEvent, ) -> Result<()>
fn mouse_wheel_event( &self, _host: &mut Self::Host, _event: MouseWheelEvent, ) -> Result<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".