[−][src]Struct xsk_rs::umem::FrameDesc
Describes a UMEM frame's address and size of its current contents.
The addr
field is an offset in bytes from the start of the UMEM
and corresponds to some point within a frame. The len
field
describes the length (in bytes) of any data stored in that frame,
starting from addr
.
If sending data, the len
field will need to be set by the user
before transmitting via the TxQueue.
Otherwise when reading received frames using the
RxQueue, the len
field will be set by the
kernel and dictates the number of bytes the user should read from
the UMEM.
Implementations
impl FrameDesc<'_>
[src]
pub fn addr(&self) -> usize
[src]
pub fn len(&self) -> usize
[src]
pub fn options(&self) -> u32
[src]
pub fn set_addr(&mut self, addr: usize)
[src]
Set the frame descriptor's address. This determines where in the UMEM it references.
Manual setting shouldn't generally be required is likely best avoided since the setting of addresses is handled by the library, however it may be needed if writing straight to a region in UMEM via umem_region_mut or umem_region_mut_checked
pub fn set_len(&mut self, len: usize)
[src]
Set the frame descriptor's length. This should equal the
length of the data stored at addr
.
Once data has been written to the UMEM region starting at
addr
, this FrameDesc
's length must be updated before
handing it over to the kernel to be transmitted to ensure the
correct number of bytes are sent.
Manual setting shouldn't generally be required and if copying
packets to UMEM it's better to use
write_to_umem or
write_to_umem_checked
which will handle setting the frame descriptor length, however
it may be needed if writing to a UMEM region manually (see
set_addr
) or if, for example, the data you want to send is
already at addr
and you just need to set the length before
transmission.
pub fn set_options(&mut self, options: u32)
[src]
Set the frame descriptor options.
Trait Implementations
impl<'umem> Clone for FrameDesc<'umem>
[src]
impl<'umem> Debug for FrameDesc<'umem>
[src]
impl<'umem> PartialEq<FrameDesc<'umem>> for FrameDesc<'umem>
[src]
fn eq(&self, other: &FrameDesc<'umem>) -> bool
[src]
fn ne(&self, other: &FrameDesc<'umem>) -> bool
[src]
impl<'umem> StructuralPartialEq for FrameDesc<'umem>
[src]
Auto Trait Implementations
impl<'umem> RefUnwindSafe for FrameDesc<'umem>
[src]
impl<'umem> Send for FrameDesc<'umem>
[src]
impl<'umem> Sync for FrameDesc<'umem>
[src]
impl<'umem> Unpin for FrameDesc<'umem>
[src]
impl<'umem> UnwindSafe for FrameDesc<'umem>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,