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>
impl<'buf> RecvMsgOut<'buf>
sourcepub fn parse(buffer: &'buf [u8], msghdr: &msghdr) -> Result<Self, ()>
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).
sourcepub fn incoming_name_len(&self) -> u32
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.
sourcepub fn is_name_data_truncated(&self) -> bool
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.
sourcepub fn name_data(&self) -> &[u8] ⓘ
pub fn name_data(&self) -> &[u8] ⓘ
Message control data, with the same semantics as msghdr.msg_control
.
sourcepub fn incoming_control_len(&self) -> u32
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.
sourcepub fn is_control_data_truncated(&self) -> bool
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.
sourcepub fn control_data(&self) -> &[u8] ⓘ
pub fn control_data(&self) -> &[u8] ⓘ
Message control data, with the same semantics as msghdr.msg_control
.
sourcepub fn is_payload_truncated(&self) -> bool
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.
sourcepub fn payload_data(&self) -> &[u8] ⓘ
pub fn payload_data(&self) -> &[u8] ⓘ
Message payload, as buffered by the kernel.
sourcepub fn incoming_payload_len(&self) -> u32
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.