@@ -8,11 +8,13 @@ use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr};
8
8
/// as possibly some version-dependent additional information. See [`SocketAddrV4`]'s and
9
9
/// [`SocketAddrV6`]'s respective documentation for more details.
10
10
///
11
- /// The size of a `SocketAddr` instance may vary depending on the target operating
12
- /// system.
13
- ///
14
11
/// [IP address]: IpAddr
15
12
///
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
+ ///
16
18
/// # Examples
17
19
///
18
20
/// ```
@@ -42,13 +44,14 @@ pub enum SocketAddr {
42
44
///
43
45
/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
44
46
///
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
- ///
49
47
/// [IETF RFC 793]: https://tools.ietf.org/html/rfc793
50
48
/// [`IPv4` address]: Ipv4Addr
51
49
///
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
+ ///
52
55
/// # Textual representation
53
56
///
54
57
/// `SocketAddrV4` provides a [`FromStr`](crate::str::FromStr) implementation.
@@ -84,13 +87,14 @@ pub struct SocketAddrV4 {
84
87
///
85
88
/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
86
89
///
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
- ///
91
90
/// [IETF RFC 2553, Section 3.3]: https://tools.ietf.org/html/rfc2553#section-3.3
92
91
/// [`IPv6` address]: Ipv6Addr
93
92
///
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
+ ///
94
98
/// # Textual representation
95
99
///
96
100
/// `SocketAddrV6` provides a [`FromStr`](crate::str::FromStr) implementation,
0 commit comments