Skip to main content

InterfaceHandler

Struct InterfaceHandler 

Source
pub struct InterfaceHandler {
    pub advance_clock: Option<Box<dyn FnMut(i64) -> u8>>,
    pub read_data: Option<Box<dyn Fn(AccessClass, u32, u32) -> Vec<u8>>>,
    pub write_data: Option<Box<dyn FnMut(AccessClass, u32, &[u8])>>,
    pub ymfm_external_read: Option<Box<dyn FnMut(AccessClass, u32) -> u8>>,
    pub ymfm_external_write: Option<Box<dyn FnMut(AccessClass, u32, u8)>>,
    pub ymfm_is_busy: Option<Box<dyn Fn() -> bool>>,
    pub ymfm_set_busy_end: Option<Box<dyn FnMut(u32)>>,
    pub ymfm_set_timer: Option<Box<dyn FnMut(u32, i32)>>,
    pub ymfm_update_irq: Option<Box<dyn FnMut(bool)>>,
}
Expand description

User-provided ymfm interface handlers. Each callback is optional; omitted callbacks use the corresponding no-op/default behavior.

Fields§

§advance_clock: Option<Box<dyn FnMut(i64) -> u8>>§read_data: Option<Box<dyn Fn(AccessClass, u32, u32) -> Vec<u8>>>§write_data: Option<Box<dyn FnMut(AccessClass, u32, &[u8])>>§ymfm_external_read: Option<Box<dyn FnMut(AccessClass, u32) -> u8>>§ymfm_external_write: Option<Box<dyn FnMut(AccessClass, u32, u8)>>§ymfm_is_busy: Option<Box<dyn Fn() -> bool>>§ymfm_set_busy_end: Option<Box<dyn FnMut(u32)>>§ymfm_set_timer: Option<Box<dyn FnMut(u32, i32)>>§ymfm_update_irq: Option<Box<dyn FnMut(bool)>>

Trait Implementations§

Source§

impl Default for InterfaceHandler

Source§

fn default() -> InterfaceHandler

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.