VhostUserHandleBackend

Trait VhostUserHandleBackend 

Source
pub trait VhostUserHandleBackend: Sized {
Show 16 methods // Provided methods fn from_stream(_sock: UnixStream, _max_queue_num: u64) -> Self { ... } fn set_hdr_flags(&self, _flags: VhostUserHeaderFlag) { ... } fn get_features(&self) -> Result<u64, Error> { ... } fn set_features(&self, _features: u64) -> Result<(), Error> { ... } fn set_owner(&self) -> Result<(), Error> { ... } fn set_mem_table( &self, _regions: &[VhostUserMemoryRegionInfo], ) -> Result<(), Error> { ... } fn set_vring_num(&self, _queue_index: usize, _num: u16) -> Result<(), Error> { ... } fn set_vring_addr( &self, _queue_index: usize, _config_data: &VringConfigData, ) -> Result<(), Error> { ... } fn set_vring_base( &self, _queue_index: usize, _base: u16, ) -> Result<(), Error> { ... } fn set_vring_call( &self, _queue_index: usize, _fd: &EventFd, ) -> Result<(), Error> { ... } fn set_vring_kick( &self, _queue_index: usize, _fd: &EventFd, ) -> Result<(), Error> { ... } fn get_protocol_features( &mut self, ) -> Result<VhostUserProtocolFeatures, Error> { ... } fn set_protocol_features( &mut self, _features: VhostUserProtocolFeatures, ) -> Result<(), Error> { ... } fn set_vring_enable( &mut self, _queue_index: usize, _enable: bool, ) -> Result<(), Error> { ... } fn get_config( &mut self, _offset: u32, _size: u32, _flags: VhostUserConfigFlags, _buf: &[u8], ) -> Result<(VhostUserConfig, VhostUserConfigPayload), Error> { ... } fn set_config( &mut self, _offset: u32, _flags: VhostUserConfigFlags, _buf: &[u8], ) -> Result<(), Error> { ... }
}

Provided Methods§

Source

fn from_stream(_sock: UnixStream, _max_queue_num: u64) -> Self

Constructor of Frontend

Source

fn set_hdr_flags(&self, _flags: VhostUserHeaderFlag)

Source

fn get_features(&self) -> Result<u64, Error>

Get from the underlying vhost implementation the feature bitmask.

Source

fn set_features(&self, _features: u64) -> Result<(), Error>

Enable features in the underlying vhost implementation using a bitmask.

Source

fn set_owner(&self) -> Result<(), Error>

Set the current Frontend as an owner of the session.

Source

fn set_mem_table( &self, _regions: &[VhostUserMemoryRegionInfo], ) -> Result<(), Error>

Set the memory map regions on the slave so it can translate the vring addresses. In the ancillary data there is an array of file descriptors

Source

fn set_vring_num(&self, _queue_index: usize, _num: u16) -> Result<(), Error>

Set the size of the queue.

Source

fn set_vring_addr( &self, _queue_index: usize, _config_data: &VringConfigData, ) -> Result<(), Error>

Sets the addresses of the different aspects of the vring.

Source

fn set_vring_base(&self, _queue_index: usize, _base: u16) -> Result<(), Error>

Sets the base offset in the available vring.

Source

fn set_vring_call( &self, _queue_index: usize, _fd: &EventFd, ) -> Result<(), Error>

Set the event file descriptor to signal when buffers are used. Bits (0-7) of the payload contain the vring index. Bit 8 is the invalid FD flag. This flag is set when there is no file descriptor in the ancillary data. This signals that polling will be used instead of waiting for the call.

Source

fn set_vring_kick( &self, _queue_index: usize, _fd: &EventFd, ) -> Result<(), Error>

Set the event file descriptor for adding buffers to the vring. Bits (0-7) of the payload contain the vring index. Bit 8 is the invalid FD flag. This flag is set when there is no file descriptor in the ancillary data. This signals that polling should be used instead of waiting for a kick.

Source

fn get_protocol_features(&mut self) -> Result<VhostUserProtocolFeatures, Error>

Source

fn set_protocol_features( &mut self, _features: VhostUserProtocolFeatures, ) -> Result<(), Error>

Source

fn set_vring_enable( &mut self, _queue_index: usize, _enable: bool, ) -> Result<(), Error>

Source

fn get_config( &mut self, _offset: u32, _size: u32, _flags: VhostUserConfigFlags, _buf: &[u8], ) -> Result<(VhostUserConfig, VhostUserConfigPayload), Error>

Source

fn set_config( &mut self, _offset: u32, _flags: VhostUserConfigFlags, _buf: &[u8], ) -> Result<(), Error>

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.

Implementations on Foreign Types§

Source§

impl VhostUserHandleBackend for Frontend

Source§

fn get_features(&self) -> Result<u64, Error>

Get from the underlying vhost implementation the feature bitmask.

Source§

fn set_features(&self, features: u64) -> Result<(), Error>

Enable features in the underlying vhost implementation using a bitmask.

Source§

fn set_owner(&self) -> Result<(), Error>

Set the current Frontend as an owner of the session.

Source§

fn set_mem_table( &self, regions: &[VhostUserMemoryRegionInfo], ) -> Result<(), Error>

Set the memory map regions on the slave so it can translate the vring addresses. In the ancillary data there is an array of file descriptors

Source§

fn set_vring_num(&self, queue_index: usize, num: u16) -> Result<(), Error>

Set the size of the queue.

Source§

fn set_vring_addr( &self, queue_index: usize, config_data: &VringConfigData, ) -> Result<(), Error>

Sets the addresses of the different aspects of the vring.

Source§

fn set_vring_base(&self, queue_index: usize, base: u16) -> Result<(), Error>

Sets the base offset in the available vring.

Source§

fn set_vring_call(&self, queue_index: usize, fd: &EventFd) -> Result<(), Error>

Set the event file descriptor to signal when buffers are used. Bits (0-7) of the payload contain the vring index. Bit 8 is the invalid FD flag. This flag is set when there is no file descriptor in the ancillary data. This signals that polling will be used instead of waiting for the call.

Source§

fn set_vring_kick(&self, queue_index: usize, fd: &EventFd) -> Result<(), Error>

Set the event file descriptor for adding buffers to the vring. Bits (0-7) of the payload contain the vring index. Bit 8 is the invalid FD flag. This flag is set when there is no file descriptor in the ancillary data. This signals that polling should be used instead of waiting for a kick.

Source§

fn from_stream(sock: UnixStream, max_queue_num: u64) -> Self

Source§

fn set_hdr_flags(&self, flags: VhostUserHeaderFlag)

Source§

fn get_protocol_features(&mut self) -> Result<VhostUserProtocolFeatures, Error>

Source§

fn set_protocol_features( &mut self, features: VhostUserProtocolFeatures, ) -> Result<(), Error>

Source§

fn set_vring_enable( &mut self, queue_index: usize, enable: bool, ) -> Result<(), Error>

Source§

fn get_config( &mut self, offset: u32, size: u32, flags: VhostUserConfigFlags, buf: &[u8], ) -> Result<(VhostUserConfig, VhostUserConfigPayload), Error>

Source§

fn set_config( &mut self, offset: u32, flags: VhostUserConfigFlags, buf: &[u8], ) -> Result<(), Error>

Implementors§