pub trait System {
    // Required methods
    fn get_cpu_mut(&mut self) -> Box<&mut dyn Cpu>;
    fn tick(&mut self) -> Duration;
    fn reset(&mut self);
    fn render(&mut self, framebuffer: &mut [u8], window: WindowConfig);

    // Provided methods
    fn attach_trace_handler(&mut self, handler: Box<dyn TraceHandler>) { ... }
    fn cleanup(&mut self) -> Result<(), &str> { ... }
}
Expand description

A representation of an emulated system.

Required Methods§

source

fn get_cpu_mut(&mut self) -> Box<&mut dyn Cpu>

Return a mutable reference to the CPU used in this system.

source

fn tick(&mut self) -> Duration

Advance the system by one tick.

source

fn reset(&mut self)

Reset the system’s state.

source

fn render(&mut self, framebuffer: &mut [u8], window: WindowConfig)

Render the current state of the system to the given framebuffer.

Provided Methods§

source

fn attach_trace_handler(&mut self, handler: Box<dyn TraceHandler>)

source

fn cleanup(&mut self) -> Result<(), &str>

Clean up any resources used by this system.

Implementors§