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§
Sourcefn save_state(&self) -> Vec<u8> ⓘ
fn save_state(&self) -> Vec<u8> ⓘ
Everything of the device that changes as the console runs.
Sourcefn load_state(&mut self, data: &[u8]) -> Result<(), String>
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.
Sourcefn state_identity(&self) -> String
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.