pub trait SimpleVmbusDevice: 'static + Send {
type SavedState: SavedStateRoot + Send;
type Runner: 'static + Send;
// Required methods
fn offer(&self) -> OfferParams;
fn inspect(&mut self, req: Request<'_>, runner: Option<&mut Self::Runner>);
fn open(
&mut self,
channel: RawAsyncChannel<GpadlRingMem>,
guest_memory: GuestMemory,
) -> Result<Self::Runner, ChannelOpenError>;
fn run<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
stop: &'life1 mut StopTask<'life2>,
runner: &'life3 mut Self::Runner,
) -> Pin<Box<dyn Future<Output = Result<(), Cancelled>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn supports_save_restore(
&mut self,
) -> Option<&mut dyn SaveRestoreSimpleVmbusDevice<SavedState = Self::SavedState, Runner = Self::Runner>>;
// Provided method
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Expand description
A trait implemented by a simple vmbus device with no subchannels.
Required Associated Types§
Sourcetype SavedState: SavedStateRoot + Send
type SavedState: SavedStateRoot + Send
The saved state type.
Required Methods§
Sourcefn offer(&self) -> OfferParams
fn offer(&self) -> OfferParams
The channel offer parameters.
Sourcefn open(
&mut self,
channel: RawAsyncChannel<GpadlRingMem>,
guest_memory: GuestMemory,
) -> Result<Self::Runner, ChannelOpenError>
fn open( &mut self, channel: RawAsyncChannel<GpadlRingMem>, guest_memory: GuestMemory, ) -> Result<Self::Runner, ChannelOpenError>
Opens the channel, returning the runner to use to run the channel.
When the channel is closed, the runner will be dropped.
Sourcefn run<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
stop: &'life1 mut StopTask<'life2>,
runner: &'life3 mut Self::Runner,
) -> Pin<Box<dyn Future<Output = Result<(), Cancelled>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn run<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
stop: &'life1 mut StopTask<'life2>,
runner: &'life3 mut Self::Runner,
) -> Pin<Box<dyn Future<Output = Result<(), Cancelled>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Runs an open channel until stop
is signaled.
Sourcefn supports_save_restore(
&mut self,
) -> Option<&mut dyn SaveRestoreSimpleVmbusDevice<SavedState = Self::SavedState, Runner = Self::Runner>>
fn supports_save_restore( &mut self, ) -> Option<&mut dyn SaveRestoreSimpleVmbusDevice<SavedState = Self::SavedState, Runner = Self::Runner>>
Returns a trait used to save/restore the device.
Returns None
if the device should be revoked and reoffered on restore.