Struct vhost::net::fakes::FakeNet

source ·
pub struct FakeNet<T> {
    descriptor: File,
    phantom: PhantomData<T>,
}

Fields§

§descriptor: File§phantom: PhantomData<T>

Trait Implementations§

source§

impl<T> AsRawDescriptor for FakeNet<T>

source§

fn as_raw_descriptor(&self) -> RawDescriptor

Returns the underlying raw descriptor. Read more
source§

impl<T> Drop for FakeNet<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

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

source§

fn new(_vhost_net_device_path: &Path) -> Result<FakeNet<T>>

Create a new NetT instance
source§

fn set_backend(&self, _queue_index: usize, _fd: 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. Read more
source§

impl<T> Vhost for FakeNet<T>

source§

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

Set the current process as the owner of this file descriptor. This must be run before any other vhost ioctls.
source§

fn reset_owner(&self) -> Result<()>

Give up ownership and reset the device to default values. Allows a subsequent call to set_owner to succeed.
source§

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

Get a bitmask of supported virtio/vhost features.
source§

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

Inform the vhost subsystem which features to enable. This should be a subset of supported features from VHOST_GET_FEATURES. Read more
source§

fn set_mem_table(&self, mem: &GuestMemory) -> Result<()>

Set the guest memory mappings for vhost to use.
source§

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

Set the number of descriptors in the vring. Read more
source§

fn is_valid( &self, mem: &GuestMemory, queue_max_size: u16, queue_size: u16, desc_addr: GuestAddress, avail_addr: GuestAddress, used_addr: GuestAddress ) -> bool

source§

fn set_vring_addr( &self, mem: &GuestMemory, queue_max_size: u16, queue_size: u16, queue_index: usize, flags: u32, desc_addr: GuestAddress, used_addr: GuestAddress, avail_addr: GuestAddress, log_addr: Option<GuestAddress> ) -> Result<()>

Set the addresses for a given vring. Read more
source§

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

Set the first index to look for available descriptors. Read more
source§

fn get_vring_base(&self, queue_index: usize) -> Result<u16>

Gets the index of the next available descriptor in the queue. Read more
source§

fn set_vring_call(&self, queue_index: usize, event: &Event) -> Result<()>

Set the event to trigger when buffers have been used by the host. Read more
source§

fn set_vring_err(&self, queue_index: usize, event: &Event) -> Result<()>

Set the event to trigger to signal an error. Read more
source§

fn set_vring_kick(&self, queue_index: usize, event: &Event) -> Result<()>

Set the event that will be signaled by the guest when buffers are available for the host to process. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for FakeNet<T>where T: RefUnwindSafe,

§

impl<T> Send for FakeNet<T>where T: Send,

§

impl<T> Sync for FakeNet<T>where T: Sync,

§

impl<T> Unpin for FakeNet<T>where T: Unpin,

§

impl<T> UnwindSafe for FakeNet<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsRawDescriptors for Twhere T: AsRawDescriptor,

§

fn as_raw_descriptors(&self) -> Vec<i32, Global>

Returns the underlying raw descriptors. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.