Trait 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.

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.

Implementors§

Source§

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

Source§

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