Struct xdpsock::RxQueue[][src]

pub struct RxQueue<'umem> { /* fields omitted */ }

The receiving side of an AF_XDP socket.

More details can be found in the docs.

Implementations

impl RxQueue<'_>[src]

pub fn consume(&mut self, descs: &mut [Frame<'_>]) -> usize[src]

Populate descs with information on packets received on the rx ring.

The number of entries updated will be less than or equal to the length of descs. Entries will be updated sequentially from the start of descs until the end. Returns the number of elements of descs which have been updated with received packet information, namely their frame address and length.

Once the contents of the consumed frames have been dealt with and are no longer required, the frames should eventually be added back on to either the FillQueue or the TxQueue.

pub fn poll_and_consume(
    &mut self,
    descs: &mut [Frame<'_>],
    poll_timeout: i32
) -> Result<usize>
[src]

Same as consume but poll first to check if there is anything to read beforehand.

pub fn fd(&mut self) -> &mut Fd[src]

Return the AF_XDP socket’s file descriptor.

Required for poll_read or poll_write.

Trait Implementations

impl<'umem> Debug for RxQueue<'umem>[src]

impl Send for RxQueue<'_>[src]

Auto Trait Implementations

impl<'umem> RefUnwindSafe for RxQueue<'umem>

impl<'umem> !Sync for RxQueue<'umem>

impl<'umem> Unpin for RxQueue<'umem>

impl<'umem> UnwindSafe for RxQueue<'umem>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.