pub trait BusDeviceSync: BusDevice + Sync {
    // Required methods
    fn read(&self, offset: BusAccessInfo, data: &mut [u8]);
    fn write(&self, offset: BusAccessInfo, data: &[u8]);

    // Provided methods
    fn snapshot_sync(&self) -> Result<Value> { ... }
    fn restore_sync(&self, _data: Value) -> Result<()> { ... }
    fn sleep_sync(&self) -> Result<()> { ... }
    fn wake_sync(&self) -> Result<()> { ... }
}

Required Methods§

source

fn read(&self, offset: BusAccessInfo, data: &mut [u8])

source

fn write(&self, offset: BusAccessInfo, data: &[u8])

Provided Methods§

source

fn snapshot_sync(&self) -> Result<Value>

source

fn restore_sync(&self, _data: Value) -> Result<()>

Load a saved snapshot of an image.

source

fn sleep_sync(&self) -> Result<()>

Stop all threads related to the device. Sleep should be idempotent.

source

fn wake_sync(&self) -> Result<()>

Create/Resume all threads related to the device. Wake should be idempotent.

Implementors§