Persist

Trait Persist 

Source
pub trait Persist<'a>
where Self: Sized,
{ type State; type ConstructorArgs; type Error; // Required methods fn save(&self) -> Self::State; fn restore( constructor_args: Self::ConstructorArgs, state: &Self::State, ) -> Result<Self, Self::Error>; }
Expand description

An abstract interface for saving/restoring a component using a specific state.

Required Associated Types§

Source

type State

The type of the object representing the state of the component.

Source

type ConstructorArgs

The type of the object holding the constructor arguments.

Source

type Error

The type of the error that can occur while constructing the object.

Required Methods§

Source

fn save(&self) -> Self::State

Returns the current state of the component.

Source

fn restore( constructor_args: Self::ConstructorArgs, state: &Self::State, ) -> Result<Self, Self::Error>

Constructs a component from a specified state.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Persist<'_> for Block

Source§

impl Persist<'_> for Balloon

Source§

impl Persist<'_> for VirtioBlock

Source§

impl Persist<'_> for VirtioMem

Source§

impl Persist<'_> for Net

Source§

impl Persist<'_> for Queue

Source§

impl Persist<'_> for Entropy

Source§

impl Persist<'_> for MmioTransport

Source§

impl Persist<'_> for VsockUnixBackend

Source§

impl Persist<'_> for MmdsNetworkStack

Source§

impl Persist<'_> for RateLimiter

Source§

impl Persist<'_> for TokenBucket

Source§

impl Persist<'_> for VhostUserBlock

Source§

impl<'a> Persist<'a> for ACPIDeviceManager

Source§

impl<'a> Persist<'a> for MMIODeviceManager

Source§

impl<'a> Persist<'a> for PciDevices

Source§

impl<'a> Persist<'a> for DeviceManager

Source§

impl<'a> Persist<'a> for VmClock

Source§

impl<'a> Persist<'a> for VmGenId

Source§

impl<'a> Persist<'a> for Pmem

Source§

impl<'a> Persist<'a> for MsixVectorGroup

Source§

impl<'a> Persist<'a> for ResourceAllocator

Source§

impl<B> Persist<'_> for Vsock<B>
where B: VsockBackend + 'static + Debug,