DeviceState

Trait DeviceState 

Source
pub trait DeviceState {
    // Provided methods
    fn save_state(&self) -> Vec<u8> ⓘ { ... }
    fn load_state(&mut self, data: &[u8]) -> Result<(), String> { ... }
    fn state_identity(&self) -> String { ... }
}
Expand description

What a save state needs of a socket’s device (the reference walks the object graph).

Provided Methods§

Source

fn save_state(&self) -> Vec<u8> ⓘ

Everything of the device that changes as the console runs.

Source

fn load_state(&mut self, data: &[u8]) -> Result<(), String>

Put the device in a saved state. A device without state accepts only an empty one.

Source

fn state_identity(&self) -> String

What the device is and which media it holds (a card’s ROM by its SHA-1, a disc by its table of contents): a state is refused by a system whose device answers otherwise.

Implementors§