pub struct TxRing { /* private fields */ }Expand description
Circular descriptor ring for AF_XDP TX packets.
Implementations§
Source§impl TxRing
impl TxRing
Sourcepub fn new(capacity: u32) -> Self
pub fn new(capacity: u32) -> Self
Creates a new TX 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 TX 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 TX 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 TxRing
impl RefUnwindSafe for TxRing
impl Send for TxRing
impl Sync for TxRing
impl Unpin for TxRing
impl UnsafeUnpin for TxRing
impl UnwindSafe for TxRing
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