pub struct MsgHdr<'addr, 'bufs, 'control> {
pub(crate) inner: msghdr,
pub(crate) _lifetimes: PhantomData<(&'addr SockAddr, &'bufs IoSlice<'bufs>, &'control [u8])>,
}
Expand description
Configuration of a sendmsg(2)
system call.
This wraps msghdr
on Unix and WSAMSG
on Windows. Also see MsgHdrMut
for the variant used by recvmsg(2)
.
Fields§
§inner: msghdr
§_lifetimes: PhantomData<(&'addr SockAddr, &'bufs IoSlice<'bufs>, &'control [u8])>
Implementations§
source§impl<'addr, 'bufs, 'control> MsgHdr<'addr, 'bufs, 'control>
impl<'addr, 'bufs, 'control> MsgHdr<'addr, 'bufs, 'control>
sourcepub fn with_addr(self, addr: &'addr SockAddr) -> Self
pub fn with_addr(self, addr: &'addr SockAddr) -> Self
Set the address (name) of the message.
Corresponds to setting msg_name
and msg_namelen
on Unix and name
and namelen
on Windows.
sourcepub fn with_buffers(self, bufs: &'bufs [IoSlice<'_>]) -> Self
pub fn with_buffers(self, bufs: &'bufs [IoSlice<'_>]) -> Self
Set the buffer(s) of the message.
Corresponds to setting msg_iov
and msg_iovlen
on Unix and lpBuffers
and dwBufferCount
on Windows.
sourcepub fn with_control(self, buf: &'control [u8]) -> Self
pub fn with_control(self, buf: &'control [u8]) -> Self
Set the control buffer of the message.
Corresponds to setting msg_control
and msg_controllen
on Unix and
Control
on Windows.
sourcepub fn with_flags(self, flags: c_int) -> Self
pub fn with_flags(self, flags: c_int) -> Self
Set the flags of the message.
Corresponds to setting msg_flags
on Unix and dwFlags
on Windows.
Trait Implementations§
Auto Trait Implementations§
impl<'addr, 'bufs, 'control> Freeze for MsgHdr<'addr, 'bufs, 'control>
impl<'addr, 'bufs, 'control> RefUnwindSafe for MsgHdr<'addr, 'bufs, 'control>
impl<'addr, 'bufs, 'control> !Send for MsgHdr<'addr, 'bufs, 'control>
impl<'addr, 'bufs, 'control> !Sync for MsgHdr<'addr, 'bufs, 'control>
impl<'addr, 'bufs, 'control> Unpin for MsgHdr<'addr, 'bufs, 'control>
impl<'addr, 'bufs, 'control> UnwindSafe for MsgHdr<'addr, 'bufs, 'control>
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