pub trait SimpleVmbusClientDevice {
type SavedState: SavedStateRoot + Send + Sync;
type Runner: 'static + Send + Sync;
// Required methods
fn inspect(&mut self, req: Request<'_>, runner: Option<&mut Self::Runner>);
fn instance_id(&self) -> Guid;
fn offer(&self, offer: &OfferChannel) -> OfferResponse;
fn open(
&mut self,
channel_idx: u16,
channel: RawAsyncChannel<MemoryBlockRingBuffer>,
) -> Result<Self::Runner>;
fn close(&mut self, channel_idx: u16);
fn supports_save_restore(
&mut self,
) -> Option<&mut dyn SaveRestoreSimpleVmbusClientDevice<SavedState = Self::SavedState, Runner = Self::Runner>>;
}
Required Associated Types§
Sourcetype SavedState: SavedStateRoot + Send + Sync
type SavedState: SavedStateRoot + Send + Sync
The saved state type.
Required Methods§
Sourcefn instance_id(&self) -> Guid
fn instance_id(&self) -> Guid
Returns the instance ID of the matching device.
Sourcefn offer(&self, offer: &OfferChannel) -> OfferResponse
fn offer(&self, offer: &OfferChannel) -> OfferResponse
Respond to a new channel offer for a device matching instance_id().
Sourcefn open(
&mut self,
channel_idx: u16,
channel: RawAsyncChannel<MemoryBlockRingBuffer>,
) -> Result<Self::Runner>
fn open( &mut self, channel_idx: u16, channel: RawAsyncChannel<MemoryBlockRingBuffer>, ) -> Result<Self::Runner>
Open successful for the channel number channel_idx
.
When the channel is closed, the runner will be dropped.
Sourcefn close(&mut self, channel_idx: u16)
fn close(&mut self, channel_idx: u16)
Closes the channel number channel_idx
after the runner has been
dropped.
Sourcefn supports_save_restore(
&mut self,
) -> Option<&mut dyn SaveRestoreSimpleVmbusClientDevice<SavedState = Self::SavedState, Runner = Self::Runner>>
fn supports_save_restore( &mut self, ) -> Option<&mut dyn SaveRestoreSimpleVmbusClientDevice<SavedState = Self::SavedState, Runner = Self::Runner>>
Returns a trait used to save/restore the device.