Struct io_uring::types::RecvMsgOut

source ·
pub struct RecvMsgOut<'buf> { /* private fields */ }
Expand description

Helper structure for parsing the result of a multishot opcode::RecvMsg.

Implementations§

source§

impl<'buf> RecvMsgOut<'buf>

source

pub fn parse(buffer: &'buf [u8], msghdr: &msghdr) -> Result<Self, ()>

Parse the data buffered upon completion of a RecvMsg multishot operation.

buffer is the whole buffer previously provided to the ring, while msghdr is the same content provided as input to the corresponding SQE (only msg_namelen and msg_controllen fields are relevant).

source

pub fn incoming_name_len(&self) -> u32

Return the length of the incoming name data.

This may be larger than the size of the content returned by name_data(), if the kernel could not fit all the incoming data in the provided buffer size. In that case, name data in the result buffer gets truncated.

source

pub fn is_name_data_truncated(&self) -> bool

Return whether the incoming name data was larger than the provided limit/buffer.

When true, data returned by name_data() is truncated and incomplete.

source

pub fn name_data(&self) -> &[u8]

Message control data, with the same semantics as msghdr.msg_control.

source

pub fn incoming_control_len(&self) -> u32

Return the length of the incoming control data.

This may be larger than the size of the content returned by control_data(), if the kernel could not fit all the incoming data in the provided buffer size. In that case, control data in the result buffer gets truncated.

source

pub fn is_control_data_truncated(&self) -> bool

Return whether the incoming control data was larger than the provided limit/buffer.

When true, data returned by control_data() is truncated and incomplete.

source

pub fn control_data(&self) -> &[u8]

Message control data, with the same semantics as msghdr.msg_control.

source

pub fn is_payload_truncated(&self) -> bool

Return whether the incoming payload was larger than the provided limit/buffer.

When true, data returned by payload_data() is truncated and incomplete.

source

pub fn payload_data(&self) -> &[u8]

Message payload, as buffered by the kernel.

source

pub fn incoming_payload_len(&self) -> u32

Return the length of the incoming payload data.

This may be larger than the size of the content returned by payload_data(), if the kernel could not fit all the incoming data in the provided buffer size. In that case, payload data in the result buffer gets truncated.

source

pub fn flags(&self) -> u32

Message flags, with the same semantics as msghdr.msg_flags.

Trait Implementations§

source§

impl<'buf> Debug for RecvMsgOut<'buf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'buf> Freeze for RecvMsgOut<'buf>

§

impl<'buf> RefUnwindSafe for RecvMsgOut<'buf>

§

impl<'buf> Send for RecvMsgOut<'buf>

§

impl<'buf> Sync for RecvMsgOut<'buf>

§

impl<'buf> Unpin for RecvMsgOut<'buf>

§

impl<'buf> UnwindSafe for RecvMsgOut<'buf>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.