Skip to main content

Core

Trait Core 

Source
pub trait Core:
    Any
    + Send
    + 'static {
Show 39 methods // Required methods fn system_info(&self) -> SystemInfo; fn av_info(&self) -> SystemAvInfo; fn run(&mut self, runtime: &mut Runtime<'_>); // Provided methods fn configure_events(&mut self, _events: &mut CoreEventConfig<Self>) where Self: Sized { ... } fn on_set_environment(&mut self, _env: &mut Environment<'_>) { ... } fn init(&mut self, _env: &mut Environment<'_>) { ... } fn deinit(&mut self) { ... } fn set_controller_port_device( &mut self, _port: InputPort, _device: ControllerDevice, ) { ... } fn reset(&mut self) { ... } fn load_game( &mut self, _game: Option<GameInfo<'_>>, _runtime: &mut Runtime<'_>, ) -> bool { ... } fn load_game_special( &mut self, _subsystem: SubsystemId, _games: &[GameInfo<'_>], _runtime: &mut Runtime<'_>, ) -> bool { ... } fn unload_game(&mut self) { ... } fn serialize_size(&self) -> usize { ... } fn serialize(&self, _data: &mut [u8]) -> bool { ... } fn unserialize(&mut self, _data: &[u8]) -> bool { ... } fn cheat_reset(&mut self) { ... } fn cheat_set( &mut self, _index: CheatIndex, _enabled: bool, _code: Option<CheatCode<'_>>, ) { ... } fn region(&self) -> Region { ... } fn memory_region(&mut self, _region: MemoryRegion) -> Option<CoreMemory<'_>> { ... } fn proc_address(&mut self, _symbol: &CStr) -> Option<CoreProcAddress> { ... } fn disk_set_tray_state(&mut self, _state: DiskTrayState) -> bool { ... } fn disk_tray_state(&mut self) -> DiskTrayState { ... } fn disk_image_index(&mut self) -> DiskIndex { ... } fn disk_set_image_index(&mut self, _index: DiskIndex) -> bool { ... } fn disk_image_count(&mut self) -> u32 { ... } fn disk_replace_image_index( &mut self, _index: DiskIndex, _game: Option<GameInfo<'_>>, ) -> bool { ... } fn disk_add_image_index(&mut self) -> bool { ... } fn disk_set_initial_image( &mut self, _index: DiskIndex, _path: &CStr, ) -> bool { ... } fn disk_image_path(&mut self, _index: DiskIndex) -> Option<String> { ... } fn disk_image_label(&mut self, _index: DiskIndex) -> Option<String> { ... } fn netpacket_start(&mut self, _session: NetpacketSession) { ... } fn netpacket_receive(&mut self, _packet: Netpacket<'_>) { ... } fn netpacket_stop(&mut self) { ... } fn netpacket_poll(&mut self) { ... } fn netpacket_connected(&mut self, _client_id: NetplayClientId) -> bool { ... } fn netpacket_disconnected(&mut self, _client_id: NetplayClientId) { ... } fn core_options_update_display( &mut self, _env: &mut Environment<'_>, ) -> bool { ... } fn hw_context_reset(&mut self, _runtime: &mut Runtime<'_>) { ... } fn hw_context_destroy(&mut self, _runtime: &mut Runtime<'_>) { ... }
}
Expand description

Trait implemented by a Rust libretro core.

Required methods describe metadata, AV timing, and per-frame execution. Optional methods cover setup, content loading, savestates, disk control, hardware-render lifecycle, netpacket callbacks, and other libretro surfaces. Export an implementation with export_core!.

Required Methods§

Source

fn system_info(&self) -> SystemInfo

Source

fn av_info(&self) -> SystemAvInfo

Source

fn run(&mut self, runtime: &mut Runtime<'_>)

Provided Methods§

Source

fn configure_events(&mut self, _events: &mut CoreEventConfig<Self>)
where Self: Sized,

Source

fn on_set_environment(&mut self, _env: &mut Environment<'_>)

Source

fn init(&mut self, _env: &mut Environment<'_>)

Source

fn deinit(&mut self)

Source

fn set_controller_port_device( &mut self, _port: InputPort, _device: ControllerDevice, )

Source

fn reset(&mut self)

Source

fn load_game( &mut self, _game: Option<GameInfo<'_>>, _runtime: &mut Runtime<'_>, ) -> bool

Source

fn load_game_special( &mut self, _subsystem: SubsystemId, _games: &[GameInfo<'_>], _runtime: &mut Runtime<'_>, ) -> bool

Source

fn unload_game(&mut self)

Source

fn serialize_size(&self) -> usize

Source

fn serialize(&self, _data: &mut [u8]) -> bool

Source

fn unserialize(&mut self, _data: &[u8]) -> bool

Source

fn cheat_reset(&mut self)

Source

fn cheat_set( &mut self, _index: CheatIndex, _enabled: bool, _code: Option<CheatCode<'_>>, )

Source

fn region(&self) -> Region

Source

fn memory_region(&mut self, _region: MemoryRegion) -> Option<CoreMemory<'_>>

Source

fn proc_address(&mut self, _symbol: &CStr) -> Option<CoreProcAddress>

Source

fn disk_set_tray_state(&mut self, _state: DiskTrayState) -> bool

Source

fn disk_tray_state(&mut self) -> DiskTrayState

Source

fn disk_image_index(&mut self) -> DiskIndex

Source

fn disk_set_image_index(&mut self, _index: DiskIndex) -> bool

Source

fn disk_image_count(&mut self) -> u32

Source

fn disk_replace_image_index( &mut self, _index: DiskIndex, _game: Option<GameInfo<'_>>, ) -> bool

Source

fn disk_add_image_index(&mut self) -> bool

Source

fn disk_set_initial_image(&mut self, _index: DiskIndex, _path: &CStr) -> bool

Source

fn disk_image_path(&mut self, _index: DiskIndex) -> Option<String>

Source

fn disk_image_label(&mut self, _index: DiskIndex) -> Option<String>

Source

fn netpacket_start(&mut self, _session: NetpacketSession)

Source

fn netpacket_receive(&mut self, _packet: Netpacket<'_>)

Source

fn netpacket_stop(&mut self)

Source

fn netpacket_poll(&mut self)

Source

fn netpacket_connected(&mut self, _client_id: NetplayClientId) -> bool

Source

fn netpacket_disconnected(&mut self, _client_id: NetplayClientId)

Source

fn core_options_update_display(&mut self, _env: &mut Environment<'_>) -> bool

Source

fn hw_context_reset(&mut self, _runtime: &mut Runtime<'_>)

Source

fn hw_context_destroy(&mut self, _runtime: &mut Runtime<'_>)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§