pub struct RxBuffer { /* private fields */ }
Expand description
A buffer used for receiving.
Implementations§
Source§impl RxBuffer
impl RxBuffer
Sourcepub const fn packet_len(&self) -> usize
pub const fn packet_len(&self) -> usize
Returns the network packet length (witout header).
Sourcepub fn as_bytes(&self) -> &[u8]
pub fn as_bytes(&self) -> &[u8]
Returns all data in the buffer, including both the header and the packet.
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8]
pub fn as_bytes_mut(&mut self) -> &mut [u8]
Returns all data in the buffer with the mutable reference, including both the header and the packet.
Sourcepub fn header(&self) -> &VirtioNetHdr
pub fn header(&self) -> &VirtioNetHdr
Returns the reference of the header.
Sourcepub fn packet_mut(&mut self) -> &mut [u8]
pub fn packet_mut(&mut self) -> &mut [u8]
Returns the network packet as a mutable slice.