Struct virtio_drivers::device::net::RxBuffer
source · 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.
Auto Trait Implementations§
impl Freeze for RxBuffer
impl RefUnwindSafe for RxBuffer
impl Send for RxBuffer
impl Sync for RxBuffer
impl Unpin for RxBuffer
impl UnwindSafe for RxBuffer
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