Struct retina_core::memory::mbuf::Mbuf
source · pub struct Mbuf { /* private fields */ }
Expand description
A packet buffer.
This is a wrapper around a DPDK message buffer that represents a single Ethernet frame.
Implementations§
source§impl Mbuf
impl Mbuf
sourcepub fn get_data_slice(&self, offset: usize, count: usize) -> Result<&[u8]>
pub fn get_data_slice(&self, offset: usize, count: usize) -> Result<&[u8]>
Returns a byte slice of data with length count at offset.
Errors if offset
is greater than or equal to the buffer length or count
exceeds the size
of the data stored at offset
.
pub fn has_mark(&mut self, _mark: u32) -> bool
Trait Implementations§
source§impl<'a> Packet<'a> for Mbuf
impl<'a> Packet<'a> for Mbuf
source§fn header_len(&self) -> usize
fn header_len(&self) -> usize
Offset from the beginning of the header to the start of the payload.
source§fn next_header_offset(&self) -> usize
fn next_header_offset(&self) -> usize
Offset from the beginning of the packet buffer to the start of the payload.
source§fn next_header(&self) -> Option<usize>
fn next_header(&self) -> Option<usize>
Next level IANA protocol number.
Auto Trait Implementations§
impl Freeze for Mbuf
impl RefUnwindSafe for Mbuf
impl !Send for Mbuf
impl !Sync for Mbuf
impl Unpin for Mbuf
impl UnwindSafe for Mbuf
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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