pub struct RxRing { /* private fields */ }Expand description
Circular descriptor ring for AF_XDP RX packets.
Implementations§
Source§impl RxRing
impl RxRing
Sourcepub fn new(capacity: u32) -> Self
pub fn new(capacity: u32) -> Self
Creates a new RX ring with capacity descriptors. capacity must be a power of two.
Sourcepub fn produce(&mut self, desc: XskDesc) -> bool
pub fn produce(&mut self, desc: XskDesc) -> bool
Enqueues a descriptor into the RX ring. Returns false if full.
Sourcepub fn produce_batch(&mut self, descs: &[XskDesc]) -> usize
pub fn produce_batch(&mut self, descs: &[XskDesc]) -> usize
Enqueues a batch of descriptors into the RX ring. Returns count enqueued.
Sourcepub fn consume_batch(&mut self, out: &mut [XskDesc]) -> usize
pub fn consume_batch(&mut self, out: &mut [XskDesc]) -> usize
Dequeues up to out.len() descriptors into out. Returns count dequeued.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RxRing
impl RefUnwindSafe for RxRing
impl Send for RxRing
impl Sync for RxRing
impl Unpin for RxRing
impl UnsafeUnpin for RxRing
impl UnwindSafe for RxRing
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