@@ -8,11 +8,13 @@ use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr};
88/// as possibly some version-dependent additional information. See [`SocketAddrV4`]'s and
99/// [`SocketAddrV6`]'s respective documentation for more details.
1010///
11- /// The size of a `SocketAddr` instance may vary depending on the target operating
12- /// system.
13- ///
1411/// [IP address]: IpAddr
1512///
13+ /// # Portability
14+ ///
15+ /// `SocketAddr` is intended to be a portable representation of socket addresses and is likely not
16+ /// the same as the internal socket address type used by the target operating system's API.
17+ ///
1618/// # Examples
1719///
1820/// ```
@@ -42,13 +44,14 @@ pub enum SocketAddr {
4244///
4345/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
4446///
45- /// The size of a `SocketAddrV4` struct may vary depending on the target operating
46- /// system. Do not assume that this type has the same memory layout as the underlying
47- /// system representation.
48- ///
4947/// [IETF RFC 793]: https://tools.ietf.org/html/rfc793
5048/// [`IPv4` address]: Ipv4Addr
5149///
50+ /// # Portability
51+ ///
52+ /// `SocketAddrV4` is intended to be a portable representation of socket addresses and is likely not
53+ /// the same as the internal IPv4 socket address type used by the target operating system's API.
54+ ///
5255/// # Textual representation
5356///
5457/// `SocketAddrV4` provides a [`FromStr`](crate::str::FromStr) implementation.
@@ -84,13 +87,14 @@ pub struct SocketAddrV4 {
8487///
8588/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
8689///
87- /// The size of a `SocketAddrV6` struct may vary depending on the target operating
88- /// system. Do not assume that this type has the same memory layout as the underlying
89- /// system representation.
90- ///
9190/// [IETF RFC 2553, Section 3.3]: https://tools.ietf.org/html/rfc2553#section-3.3
9291/// [`IPv6` address]: Ipv6Addr
9392///
93+ /// # Portability
94+ ///
95+ /// `SocketAddrV6` is intended to be a portable representation of socket addresses and is likely not
96+ /// the same as the internal IPv6 socket address type used by the target operating system's API.
97+ ///
9498/// # Textual representation
9599///
96100/// `SocketAddrV6` provides a [`FromStr`](crate::str::FromStr) implementation,
0 commit comments