pub trait SaveRestoreSimpleVmbusDevice: SimpleVmbusDevice {
// Required methods
fn save_open(&mut self, runner: &Self::Runner) -> Self::SavedState;
fn restore_open(
&mut self,
state: Self::SavedState,
channel: RawAsyncChannel<GpadlRingMem>,
) -> Result<Self::Runner, ChannelOpenError>;
}
Expand description
Trait implemented by simple vmbus devices that support save/restore.
If you implement this, make sure to return Some(self)
from SimpleVmbusDevice::supports_save_restore
.
Required Methods§
Sourcefn save_open(&mut self, runner: &Self::Runner) -> Self::SavedState
fn save_open(&mut self, runner: &Self::Runner) -> Self::SavedState
Saves the channel.
Will only be called if the channel is open. If there is state to save on
a closed channel, implement VmbusDevice
instead.
Sourcefn restore_open(
&mut self,
state: Self::SavedState,
channel: RawAsyncChannel<GpadlRingMem>,
) -> Result<Self::Runner, ChannelOpenError>
fn restore_open( &mut self, state: Self::SavedState, channel: RawAsyncChannel<GpadlRingMem>, ) -> Result<Self::Runner, ChannelOpenError>
Restores the channel.
Will only be called if the channel was saved open. If there is state to
save on a closed channel, implement VmbusDevice
instead.