vmbus_relay_intercept_device

Trait SimpleVmbusClientDevice

Source
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§

Source

type SavedState: SavedStateRoot + Send + Sync

The saved state type.

Source

type Runner: 'static + Send + Sync

The type used to run an open channel.

Required Methods§

Source

fn inspect(&mut self, req: Request<'_>, runner: Option<&mut Self::Runner>)

Inspects a channel.

Source

fn instance_id(&self) -> Guid

Returns the instance ID of the matching device.

Source

fn offer(&self, offer: &OfferChannel) -> OfferResponse

Respond to a new channel offer for a device matching instance_id().

Source

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.

Source

fn close(&mut self, channel_idx: u16)

Closes the channel number channel_idx after the runner has been dropped.

Source

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.

Implementors§