@@ -12,9 +12,7 @@ use {IpAddr, Ipv4Addr, Ipv6Addr};
12
12
/// as possibly some version-dependent additional information. See [`SocketAddrV4`]'s and
13
13
/// [`SocketAddrV6`]'s respective documentation for more details.
14
14
///
15
- /// [IP address]: ../../no-std-net/enum.IpAddr.html
16
- /// [`SocketAddrV4`]: ../../no-std-net/struct.SocketAddrV4.html
17
- /// [`SocketAddrV6`]: ../../no-std-net/struct.SocketAddrV6.html
15
+ /// [IP address]: IpAddr
18
16
///
19
17
/// # Examples
20
18
///
@@ -38,7 +36,7 @@ pub enum SocketAddr {
38
36
impl SocketAddr {
39
37
/// Creates a new socket address from an [IP address] and a port number.
40
38
///
41
- /// [IP address]: ../../no-std-net/enum. IpAddr.html
39
+ /// [IP address]: IpAddr
42
40
///
43
41
/// # Examples
44
42
///
@@ -131,10 +129,8 @@ impl SocketAddr {
131
129
/// Returns [`true`] if the [IP address] in this `SocketAddr` is an
132
130
/// [IPv4 address], and [`false`] otherwise.
133
131
///
134
- /// [`true`]: ../../std/primitive.bool.html
135
- /// [`false`]: ../../std/primitive.bool.html
136
- /// [IP address]: ../../no-std-net/enum.IpAddr.html
137
- /// [IPv4 address]: ../../no-std-net/enum.IpAddr.html#variant.V4
132
+ /// [IP address]: IpAddr
133
+ /// [`IPv4` address]: IpAddr::V4
138
134
///
139
135
/// # Examples
140
136
///
@@ -157,10 +153,8 @@ impl SocketAddr {
157
153
/// Returns [`true`] if the [IP address] in this `SocketAddr` is an
158
154
/// [IPv6 address], and [`false`] otherwise.
159
155
///
160
- /// [`true`]: ../../std/primitive.bool.html
161
- /// [`false`]: ../../std/primitive.bool.html
162
- /// [IP address]: ../../no-std-net/enum.IpAddr.html
163
- /// [IPv6 address]: ../../no-std-net/enum.IpAddr.html#variant.V6
156
+ /// [IP address]: IpAddr
157
+ /// [`IPv6` address]: IpAddr::V6
164
158
///
165
159
/// # Examples
166
160
///
@@ -190,8 +184,7 @@ impl SocketAddr {
190
184
/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
191
185
///
192
186
/// [IETF RFC 793]: https://tools.ietf.org/html/rfc793
193
- /// [IPv4 address]: ../../no-std-net/struct.Ipv4Addr.html
194
- /// [`SocketAddr`]: ../../no-std-net/enum.SocketAddr.html
187
+ /// [`IPv4` address]: Ipv4Addr
195
188
///
196
189
/// # Examples
197
190
///
@@ -213,7 +206,7 @@ pub struct SocketAddrV4 {
213
206
impl SocketAddrV4 {
214
207
/// Creates a new socket address from an [IPv4 address] and a port number.
215
208
///
216
- /// [IPv4 address]: ../../no-std-net/struct. Ipv4Addr.html
209
+ /// [` IPv4` address]: Ipv4Addr
217
210
///
218
211
/// # Examples
219
212
///
@@ -297,8 +290,7 @@ impl SocketAddrV4 {
297
290
/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
298
291
///
299
292
/// [IETF RFC 2553, Section 3.3]: https://tools.ietf.org/html/rfc2553#section-3.3
300
- /// [IPv6 address]: ../../no-std-net/struct.Ipv6Addr.html
301
- /// [`SocketAddr`]: ../../no-std-net/enum.SocketAddr.html
293
+ /// [`IPv6` address]: Ipv6Addr
302
294
///
303
295
/// # Examples
304
296
///
@@ -327,7 +319,7 @@ impl SocketAddrV6 {
327
319
/// parameters, see [IETF RFC 2553, Section 3.3].
328
320
///
329
321
/// [IETF RFC 2553, Section 3.3]: https://tools.ietf.org/html/rfc2553#section-3.3
330
- /// [IPv6 address]: ../../no-std-net/struct. Ipv6Addr.html
322
+ /// [` IPv6` address]: Ipv6Addr
331
323
///
332
324
/// # Examples
333
325
///
@@ -568,18 +560,19 @@ impl ::fmt::Debug for SocketAddrV6 {
568
560
/// Addresses returned by the operating system that are not IP addresses are
569
561
/// silently ignored.
570
562
///
571
- /// [`FromStr`]: ../../std/str/trait.FromStr.html
572
- /// [`IpAddr`]: ../../no-std-net/enum.IpAddr.html
573
- /// [`Ipv4Addr`]: ../../no-std-net/struct.Ipv4Addr.html
574
- /// [`Ipv6Addr`]: ../../no-std-net/struct.Ipv6Addr.html
575
- /// [`SocketAddr`]: ../../no-std-net/enum.SocketAddr.html
576
- /// [`SocketAddrV4`]: ../../no-std-net/struct.SocketAddrV4.html
577
- /// [`SocketAddrV6`]: ../../no-std-net/struct.SocketAddrV6.html
578
- /// [`&str`]: ../../std/primitive.str.html
579
- /// [`TcpStream`]: ../../no-std-net/struct.TcpStream.html
580
- /// [`to_socket_addrs`]: #tymethod.to_socket_addrs
581
- /// [`UdpSocket`]: ../../no-std-net/struct.UdpSocket.html
582
- /// [`u16`]: ../../std/primitive.u16.html
563
+ /// [`FromStr`]: core::str::FromStr
564
+ /// [`&str`]: str
565
+ #[ cfg_attr( feature = "std" , doc = "[`TcpStream`]: std::net::TcpStream" ) ]
566
+ #[ cfg_attr(
567
+ not( feature = "std" ) ,
568
+ doc = "[`TcpStream`]: https://doc.rust-lang.org/std/net/struct.TcpStream.html"
569
+ ) ]
570
+ /// [`to_socket_addrs`]: ToSocketAddrs::to_socket_addrs
571
+ #[ cfg_attr( feature = "std" , doc = "[`UdpSocket`]: std::net::UdpSocket" ) ]
572
+ #[ cfg_attr(
573
+ not( feature = "std" ) ,
574
+ doc = "[`UdpSocket`]: https://doc.rust-lang.org/std/net/struct.UdpSocket.html"
575
+ ) ]
583
576
///
584
577
pub trait ToSocketAddrs {
585
578
/// Returned iterator over socket addresses which this type may correspond to.
0 commit comments