Trait devices::Suspendable

source ·
pub trait Suspendable {
    // Provided methods
    fn snapshot(&mut self) -> Result<Value> { ... }
    fn restore(&mut self, _data: Value) -> Result<()> { ... }
    fn sleep(&mut self) -> Result<()> { ... }
    fn wake(&mut self) -> Result<()> { ... }
}
Expand description

This trait provides the functions required for a device to implement to successfully suspend/resume in crosvm.

Provided Methods§

source

fn snapshot(&mut self) -> Result<Value>

Save the device state in an image that can be restored.

source

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

Load a saved snapshot of an image.

source

fn sleep(&mut self) -> Result<()>

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

source

fn wake(&mut self) -> Result<()>

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

Implementations on Foreign Types§

source§

impl<T: PciDevice + ?Sized> Suspendable for Box<T>

source§

fn snapshot(&mut self) -> Result<Value>

source§

fn restore(&mut self, data: Value) -> Result<()>

source§

fn sleep(&mut self) -> Result<()>

source§

fn wake(&mut self) -> Result<()>

Implementors§