@@ -569,14 +569,15 @@ impl TcpKeepalive {
569
569
}
570
570
}
571
571
572
- /// Configuration of a `{send,recv}msg ` system call.
572
+ /// Configuration of a `sendmsg(2) ` system call.
573
573
///
574
- /// This wraps `msghdr` on Unix and `WSAMSG` on Windows.
574
+ /// This wraps `msghdr` on Unix and `WSAMSG` on Windows. Also see [`MsgHdrMut`]
575
+ /// for the variant used by `recvmsg(2)`.
575
576
#[ cfg( not( target_os = "redox" ) ) ]
576
577
pub struct MsgHdr < ' addr , ' bufs , ' control > {
577
578
inner : sys:: msghdr ,
578
579
#[ allow( clippy:: type_complexity) ]
579
- _lifetimes : PhantomData < ( & ' addr SockAddr , & ' bufs [ & ' bufs [ u8 ] ] , & ' control [ u8 ] ) > ,
580
+ _lifetimes : PhantomData < ( & ' addr SockAddr , & ' bufs IoSlice < ' bufs > , & ' control [ u8 ] ) > ,
580
581
}
581
582
582
583
#[ cfg( not( target_os = "redox" ) ) ]
@@ -600,15 +601,6 @@ impl<'addr, 'bufs, 'control> MsgHdr<'addr, 'bufs, 'control> {
600
601
self
601
602
}
602
603
603
- /// Set the mutable address (name) of the message. Same as [`with_addr`],
604
- /// but with a mutable address.
605
- ///
606
- /// [`with_addr`]: MsgHdr::with_addr
607
- pub fn with_addr_mut ( mut self , addr : & ' addr mut SockAddr ) -> Self {
608
- sys:: set_msghdr_name ( & mut self . inner , addr) ;
609
- self
610
- }
611
-
612
604
/// Set the buffer(s) of the message.
613
605
///
614
606
/// Corresponds to setting `msg_iov` and `msg_iovlen` on Unix and `lpBuffers`
@@ -619,15 +611,6 @@ impl<'addr, 'bufs, 'control> MsgHdr<'addr, 'bufs, 'control> {
619
611
self
620
612
}
621
613
622
- /// Set the mutable buffer(s) of the message. Same as [`with_buffers`], but
623
- /// with mutable buffers.
624
- ///
625
- /// [`with_buffers`]: MsgHdr::with_buffers
626
- pub fn with_buffers_mut ( mut self , bufs : & ' bufs mut [ MaybeUninitSlice < ' bufs > ] ) -> Self {
627
- sys:: set_msghdr_iov ( & mut self . inner , bufs. as_mut_ptr ( ) . cast ( ) , bufs. len ( ) ) ;
628
- self
629
- }
630
-
631
614
/// Set the control buffer of the message.
632
615
///
633
616
/// Corresponds to setting `msg_control` and `msg_controllen` on Unix and
@@ -638,15 +621,6 @@ impl<'addr, 'bufs, 'control> MsgHdr<'addr, 'bufs, 'control> {
638
621
self
639
622
}
640
623
641
- /// Set the mutable control buffer of the message. Same as [`with_control`],
642
- /// but with a mutable buffers.
643
- ///
644
- /// [`with_control`]: MsgHdr::with_control
645
- pub fn with_control_mut ( mut self , buf : & ' control mut [ u8 ] ) -> Self {
646
- sys:: set_msghdr_control ( & mut self . inner , buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) ) ;
647
- self
648
- }
649
-
650
624
/// Set the flags of the message.
651
625
///
652
626
/// Corresponds to setting `msg_flags` on Unix and `dwFlags` on Windows.
0 commit comments