Trait vhost::net::NetT

source ·
pub trait NetT<T: TapT>: Vhost + AsRawDescriptor + Send + Sized {
    // Required methods
    fn new(vhost_net_device_path: &Path) -> Result<Self>;
    fn set_backend(
        &self,
        queue_index: usize,
        descriptor: Option<&T>
    ) -> Result<()>;
}

Required Methods§

source

fn new(vhost_net_device_path: &Path) -> Result<Self>

Create a new NetT instance

source

fn set_backend(&self, queue_index: usize, descriptor: Option<&T>) -> Result<()>

Set the tap file descriptor that will serve as the VHOST_NET backend. This will start the vhost worker for the given queue.

Arguments
  • queue_index - Index of the queue to modify.
  • descriptor - Tap interface that will be used as the backend.

Implementors§

source§

impl<T> NetT<T> for FakeNet<T>where T: TapT,

source§

impl<T> NetT<T> for Net<T>where T: TapT,