pub enum RingType {
Tx,
Rx,
Fill,
Completion,
}Expand description
An enum representing the four types of AF_XDP rings.
Variants§
Tx
The Transmit (TX) ring, for sending packets.
Rx
The Receive (RX) ring, for receiving packets.
Fill
The Fill ring, for providing the kernel with free UMEM frames.
Completion
The Completion ring, for retrieving used UMEM frames from the kernel.
Implementations§
Source§impl RingType
impl RingType
Sourcepub fn set_size(self, raw_fd: c_int, ring_size: usize) -> Result<()>
pub fn set_size(self, raw_fd: c_int, ring_size: usize) -> Result<()>
Sets the size of a specific ring via setsockopt.
§Arguments
raw_fd- The raw file descriptor of the XDP socket.ring_size- The number of descriptors for the ring.
Sourcepub fn mmap<T: Copy>(
self,
raw_fd: c_int,
offsets: &xdp_mmap_offsets,
ring_size: usize,
) -> Result<Ring<T>>
pub fn mmap<T: Copy>( self, raw_fd: c_int, offsets: &xdp_mmap_offsets, ring_size: usize, ) -> Result<Ring<T>>
Memory-maps a ring of a specific type.
This is a convenience method that selects the correct offsets from xdp_mmap_offsets
based on the RingType and then calls the generic Ring::mmap function.
§Arguments
raw_fd- The raw file descriptor of the XDP socket.offsets- The struct containing the memory map offsets for all rings.ring_size- The number of descriptors for the ring.
Trait Implementations§
impl Copy for RingType
impl StructuralPartialEq for RingType
Auto Trait Implementations§
impl Freeze for RingType
impl RefUnwindSafe for RingType
impl Send for RingType
impl Sync for RingType
impl Unpin for RingType
impl UnwindSafe for RingType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more