Struct virtual_nic::VirtualNic
source · pub struct VirtualNic<S, T, U, V>where
S: RxQueueRegisters + 'static,
T: RxDescriptor + 'static,
U: TxQueueRegisters + 'static,
V: TxDescriptor + 'static,{ /* private fields */ }
Expand description
A structure that contains a set of RxQueue
s and TxQueue
s that can be used to send and receive packets.
Implementations§
source§impl<S, T, U, V> VirtualNic<S, T, U, V>where
S: RxQueueRegisters + 'static,
T: RxDescriptor + 'static,
U: TxQueueRegisters + 'static,
V: TxDescriptor + 'static,
impl<S, T, U, V> VirtualNic<S, T, U, V>where S: RxQueueRegisters + 'static, T: RxDescriptor + 'static, U: TxQueueRegisters + 'static, V: TxDescriptor + 'static,
sourcepub fn new(
rx_queues: Vec<RxQueue<S, T>>,
default_rx_queue: usize,
tx_queues: Vec<TxQueue<U, V>>,
default_tx_queue: usize,
mac_address: [u8; 6],
physical_nic_ref: &'static IrqSafeMutex<dyn PhysicalNic<S, T, U, V> + Send>
) -> Result<VirtualNic<S, T, U, V>, &'static str>
pub fn new( rx_queues: Vec<RxQueue<S, T>>, default_rx_queue: usize, tx_queues: Vec<TxQueue<U, V>>, default_tx_queue: usize, mac_address: [u8; 6], physical_nic_ref: &'static IrqSafeMutex<dyn PhysicalNic<S, T, U, V> + Send> ) -> Result<VirtualNic<S, T, U, V>, &'static str>
Create a new VirtualNIC
with the given parameters.
For now we require that there is at least one Rx and one Tx queue.
pub fn id(&self) -> u8
Trait Implementations§
source§impl<S, T, U, V> Drop for VirtualNic<S, T, U, V>where
S: RxQueueRegisters + 'static,
T: RxDescriptor + 'static,
U: TxQueueRegisters + 'static,
V: TxDescriptor + 'static,
impl<S, T, U, V> Drop for VirtualNic<S, T, U, V>where S: RxQueueRegisters + 'static, T: RxDescriptor + 'static, U: TxQueueRegisters + 'static, V: TxDescriptor + 'static,
source§impl<S, T, U, V> NetworkDevice for VirtualNic<S, T, U, V>where
S: RxQueueRegisters + Send + Sync + 'static,
T: RxDescriptor + Send + Sync + 'static,
U: TxQueueRegisters + Send + Sync + 'static,
V: TxDescriptor + Send + Sync + 'static,
impl<S, T, U, V> NetworkDevice for VirtualNic<S, T, U, V>where S: RxQueueRegisters + Send + Sync + 'static, T: RxDescriptor + Send + Sync + 'static, U: TxQueueRegisters + Send + Sync + 'static, V: TxDescriptor + Send + Sync + 'static,
source§fn mac_address(&self) -> [u8; 6]
fn mac_address(&self) -> [u8; 6]
Returns the MAC address.
§fn capabilities(&self) -> DeviceCapabilities
fn capabilities(&self) -> DeviceCapabilities
Returns the device capabilities.
Auto Trait Implementations§
impl<S, T, U, V> !RefUnwindSafe for VirtualNic<S, T, U, V>
impl<S, T, U, V> Send for VirtualNic<S, T, U, V>where S: Send, T: Send, U: Send, V: Send,
impl<S, T, U, V> Sync for VirtualNic<S, T, U, V>where S: Sync, T: Sync, U: Sync, V: Sync,
impl<S, T, U, V> Unpin for VirtualNic<S, T, U, V>where S: Unpin, T: Unpin, U: Unpin, V: Unpin,
impl<S, T, U, V> !UnwindSafe for VirtualNic<S, T, U, V>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more