Skip to main content

CoreEventConfig

Struct CoreEventConfig 

Source
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>

Source

pub fn add_keyboard_event_listener( &mut self, listener: fn(&mut C, KeyboardEvent), ) -> &mut Self

Source

pub fn remove_keyboard_event_listener( &mut self, listener: fn(&mut C, KeyboardEvent), ) -> &mut Self

Source

pub fn add_audio_callback_listener(&mut self, listener: fn(&mut C)) -> &mut Self

Source

pub fn remove_audio_callback_listener( &mut self, listener: fn(&mut C), ) -> &mut Self

Source

pub fn add_audio_callback_state_changed_listener( &mut self, listener: fn(&mut C, AudioCallbackState), ) -> &mut Self

Source

pub fn remove_audio_callback_state_changed_listener( &mut self, listener: fn(&mut C, AudioCallbackState), ) -> &mut Self

Source

pub fn add_audio_buffer_status_listener( &mut self, listener: fn(&mut C, AudioBufferStatus), ) -> &mut Self

Source

pub fn remove_audio_buffer_status_listener( &mut self, listener: fn(&mut C, AudioBufferStatus), ) -> &mut Self

Source

pub fn set_frame_time_callback( &mut self, reference: FrameTime, callback: fn(&mut C, FrameTime), ) -> &mut Self

Source

pub fn clear_frame_time_callback(&mut self) -> &mut Self

Source

pub fn add_location_initialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self

Source

pub fn remove_location_initialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self

Source

pub fn add_location_deinitialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self

Source

pub fn remove_location_deinitialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self

Source

pub fn add_camera_initialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self

Source

pub fn remove_camera_initialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self

Source

pub fn add_camera_deinitialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self

Source

pub fn remove_camera_deinitialized_listener( &mut self, listener: fn(&mut C), ) -> &mut Self

Source

pub fn add_camera_raw_frame_listener( &mut self, listener: fn(&mut C, CameraRawFrame<'_>), ) -> &mut Self

Source

pub fn remove_camera_raw_frame_listener( &mut self, listener: fn(&mut C, CameraRawFrame<'_>), ) -> &mut Self

Source

pub fn add_camera_texture_frame_listener( &mut self, listener: fn(&mut C, CameraTextureFrame), ) -> &mut Self

Source

pub fn remove_camera_texture_frame_listener( &mut self, listener: fn(&mut C, CameraTextureFrame), ) -> &mut Self

Trait Implementations§

Source§

impl<C: Core> Default for CoreEventConfig<C>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.