Trait Signal

Source
pub trait Signal: Any {
    // Provided methods
    fn init(&mut self, _engine: &mut Engine) { ... }
    fn device_events(&mut self, _engine: &mut Engine, _events: &DeviceEvent) { ... }
    fn window_events(&mut self, _engine: &mut Engine, _events: &WindowEvent) { ... }
    fn frame(
        &mut self,
        _engine: &mut Engine,
        _encoder: &mut CommandEncoder,
        _view: &TextureView,
    ) { ... }
}
Expand description

Allows all events to be fetched directly, making it easier to add custom additions to the engine.

Provided Methods§

Source

fn init(&mut self, _engine: &mut Engine)

This is ran as soon as the engine is properly initialized and all components are ready

Source

fn device_events(&mut self, _engine: &mut Engine, _events: &DeviceEvent)

This is ran at the device events when available

Source

fn window_events(&mut self, _engine: &mut Engine, _events: &WindowEvent)

This is ran at the window events when available

Source

fn frame( &mut self, _engine: &mut Engine, _encoder: &mut CommandEncoder, _view: &TextureView, )

ran before the frame is rendered

Implementations§

Source§

impl dyn Signal

Source

pub fn is<_T>(&self) -> bool
where _T: Any, dyn Signal: Downcast<_T>,

Source

pub fn downcast_ref<_T>(&self) -> Result<&_T, TypeMismatch>
where _T: Any, dyn Signal: Downcast<_T>,

Source

pub fn downcast_mut<_T>(&mut self) -> Result<&mut _T, TypeMismatch>
where _T: Any, dyn Signal: Downcast<_T>,

Source

pub fn downcast<_T>( self: Box<dyn Signal>, ) -> Result<Box<_T>, DowncastError<Box<dyn Signal>>>
where _T: Any, dyn Signal: Downcast<_T>,

Source

pub fn downcast_rc<_T>( self: Rc<dyn Signal>, ) -> Result<Rc<_T>, DowncastError<Rc<dyn Signal>>>
where _T: Any, dyn Signal: Downcast<_T>,

Trait Implementations§

Source§

impl<_T> Downcast<_T> for dyn Signal
where _T: Any,

Implementors§