pub struct CoreEventConfig<C: Core> { /* private fields */ }Expand description
Event-listener registration for frontend-to-core notifications.
Register listeners from Core::configure_events. The wrapper installs the
matching low-level libretro callbacks during environment setup, avoiding
call-order bugs where a core defines a callback but forgets to enable the raw
callback separately. Listeners are dispatched in registration order.
Registering the same callback function more than once for the same event is
a no-op, matching DOM addEventListener behavior. Use the matching
remove_*_listener method with the same callback function to remove a
listener during configuration. Callback-shaped frontend hooks with one
active registration, such as frame timing, use explicit set_*_callback and
clear_*_callback methods instead.
Implementations§
Source§impl<C: Core> CoreEventConfig<C>
impl<C: Core> CoreEventConfig<C>
pub fn add_keyboard_event_listener( &mut self, listener: fn(&mut C, KeyboardEvent), ) -> &mut Self
pub fn remove_keyboard_event_listener( &mut self, listener: fn(&mut C, KeyboardEvent), ) -> &mut Self
pub fn add_audio_callback_listener(&mut self, listener: fn(&mut C)) -> &mut Self
pub fn remove_audio_callback_listener( &mut self, listener: fn(&mut C), ) -> &mut Self
pub fn add_audio_callback_state_changed_listener( &mut self, listener: fn(&mut C, AudioCallbackState), ) -> &mut Self
pub fn remove_audio_callback_state_changed_listener( &mut self, listener: fn(&mut C, AudioCallbackState), ) -> &mut Self
pub fn add_audio_buffer_status_listener( &mut self, listener: fn(&mut C, AudioBufferStatus), ) -> &mut Self
pub fn remove_audio_buffer_status_listener( &mut self, listener: fn(&mut C, AudioBufferStatus), ) -> &mut Self
pub fn set_frame_time_callback( &mut self, reference: FrameTime, callback: fn(&mut C, FrameTime), ) -> &mut Self
pub fn clear_frame_time_callback(&mut self) -> &mut Self
pub fn add_location_initialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self
pub fn remove_location_initialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self
pub fn add_location_deinitialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self
pub fn remove_location_deinitialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self
pub fn add_camera_initialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self
pub fn remove_camera_initialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self
pub fn add_camera_deinitialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self
pub fn remove_camera_deinitialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self
pub fn add_camera_raw_frame_listener( &mut self, listener: fn(&mut C, CameraRawFrame<'_>), ) -> &mut Self
pub fn remove_camera_raw_frame_listener( &mut self, listener: fn(&mut C, CameraRawFrame<'_>), ) -> &mut Self
pub fn add_camera_texture_frame_listener( &mut self, listener: fn(&mut C, CameraTextureFrame), ) -> &mut Self
pub fn remove_camera_texture_frame_listener( &mut self, listener: fn(&mut C, CameraTextureFrame), ) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for CoreEventConfig<C>
impl<C> !RefUnwindSafe for CoreEventConfig<C>
impl<C> Send for CoreEventConfig<C>
impl<C> Sync for CoreEventConfig<C>
impl<C> Unpin for CoreEventConfig<C>
impl<C> UnsafeUnpin for CoreEventConfig<C>
impl<C> !UnwindSafe for CoreEventConfig<C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more