pub struct DataPacket<'a, T: RingMem> { /* private fields */ }
Expand description
An incoming data packet.
Implementations§
Source§impl<T: RingMem> DataPacket<'_, T>
impl<T: RingMem> DataPacket<'_, T>
Sourcepub fn reader(&self) -> impl MemoryRead + '_
pub fn reader(&self) -> impl MemoryRead + '_
A reader for the data payload.
N.B. This reads the payload in place, so multiple instantiations of the reader may see multiple different results if the (malicious) opposite endpoint is mutating the ring buffer.
Sourcepub fn transaction_id(&self) -> Option<u64>
pub fn transaction_id(&self) -> Option<u64>
The packet’s transaction ID. Set if and only if a completion packet was requested.
Sourcepub fn external_range_count(&self) -> usize
pub fn external_range_count(&self) -> usize
The number of GPA direct ranges.
Sourcepub fn read_external_ranges(
&self,
) -> Result<MultiPagedRangeBuf<GpnList>, ExternalDataError>
pub fn read_external_ranges( &self, ) -> Result<MultiPagedRangeBuf<GpnList>, ExternalDataError>
Reads the GPA direct range descriptors from the packet.
Sourcepub fn transfer_buffer_id(&self) -> Option<u16>
pub fn transfer_buffer_id(&self) -> Option<u16>
Reads the transfer buffer ID from the packet, or None if this is not a transfer packet.
Sourcepub fn read_transfer_ranges<'a, I>(
&self,
transfer_buf: I,
) -> Result<MultiPagedRangeBuf<GpnList>, AccessError>where
I: Iterator<Item = PagedRange<'a>>,
pub fn read_transfer_ranges<'a, I>(
&self,
transfer_buf: I,
) -> Result<MultiPagedRangeBuf<GpnList>, AccessError>where
I: Iterator<Item = PagedRange<'a>>,
Reads the transfer descriptors from the packet using the provided buffer. This buffer should be the one associated with the value returned from transfer_buffer_id().
Auto Trait Implementations§
impl<'a, T> Freeze for DataPacket<'a, T>
impl<'a, T> RefUnwindSafe for DataPacket<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for DataPacket<'a, T>where
T: Sync,
impl<'a, T> Sync for DataPacket<'a, T>where
T: Sync,
impl<'a, T> Unpin for DataPacket<'a, T>
impl<'a, T> UnwindSafe for DataPacket<'a, T>where
T: RefUnwindSafe,
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