SaveState

Trait SaveState 

Source
pub trait SaveState {
    // Required methods
    fn is_dirty(&self) -> bool;
    fn save(&mut self, writer: &mut dyn Write) -> Result<(), Error>;
    fn load(&mut self, reader: &mut dyn Read) -> Result<(), Error>;
}
Expand description

A save state, if cores support it. This is used to save the state of the internal memory of the core, so that it can be restored later.

Required Methods§

Source

fn is_dirty(&self) -> bool

Returns true if the save state is dirty and needs to be saved.

Source

fn save(&mut self, writer: &mut dyn Write) -> Result<(), Error>

Save the state of the core to a buffer.

Source

fn load(&mut self, reader: &mut dyn Read) -> Result<(), Error>

Load the state of the core from a buffer.

Implementors§