net_backend

Trait Queue

Source
pub trait Queue: Send + InspectMut {
    // Required methods
    fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<()>;
    fn rx_avail(&mut self, done: &[RxId]);
    fn rx_poll(&mut self, packets: &mut [RxId]) -> Result<usize>;
    fn tx_avail(&mut self, segments: &[TxSegment]) -> Result<(bool, usize)>;
    fn tx_poll(&mut self, done: &mut [TxId]) -> Result<usize>;
    fn buffer_access(&mut self) -> Option<&mut dyn BufferAccess>;

    // Provided method
    fn update_target_vp<'life0, 'async_trait>(
        &'life0 mut self,
        target_vp: u32,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A trait for sending and receiving network packets.

Required Methods§

Source

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<()>

Polls the queue for readiness.

Source

fn rx_avail(&mut self, done: &[RxId])

Makes receive buffers available for use by the device.

Source

fn rx_poll(&mut self, packets: &mut [RxId]) -> Result<usize>

Polls the device for receives.

Source

fn tx_avail(&mut self, segments: &[TxSegment]) -> Result<(bool, usize)>

Posts transmits to the device.

Returns Ok(false) if the segments will complete asynchronously.

Source

fn tx_poll(&mut self, done: &mut [TxId]) -> Result<usize>

Polls the device for transmit completions.

Source

fn buffer_access(&mut self) -> Option<&mut dyn BufferAccess>

Get the buffer access.

Provided Methods§

Source

fn update_target_vp<'life0, 'async_trait>( &'life0 mut self, target_vp: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Updates the queue’s target VP.

Implementors§