@@ -22,10 +22,6 @@ use crate::vec;
22
22
/// The size of a `SocketAddr` instance may vary depending on the target operating
23
23
/// system.
24
24
///
25
- /// [IP address]: ../../std/net/enum.IpAddr.html
26
- /// [`SocketAddrV4`]: ../../std/net/struct.SocketAddrV4.html
27
- /// [`SocketAddrV6`]: ../../std/net/struct.SocketAddrV6.html
28
- ///
29
25
/// # Examples
30
26
///
31
27
/// ```
@@ -50,7 +46,7 @@ pub enum SocketAddr {
50
46
51
47
/// An IPv4 socket address.
52
48
///
53
- /// IPv4 socket addresses consist of an [IPv4 address] and a 16-bit port number, as
49
+ /// IPv4 socket addresses consist of an [` IPv4` address] and a 16-bit port number, as
54
50
/// stated in [IETF RFC 793].
55
51
///
56
52
/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
@@ -59,8 +55,7 @@ pub enum SocketAddr {
59
55
/// system.
60
56
///
61
57
/// [IETF RFC 793]: https://tools.ietf.org/html/rfc793
62
- /// [IPv4 address]: ../../std/net/struct.Ipv4Addr.html
63
- /// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
58
+ /// [`IPv4` address]: Ipv4Addr
64
59
///
65
60
/// # Examples
66
61
///
@@ -81,7 +76,7 @@ pub struct SocketAddrV4 {
81
76
82
77
/// An IPv6 socket address.
83
78
///
84
- /// IPv6 socket addresses consist of an [Ipv6 address], a 16-bit port number, as well
79
+ /// IPv6 socket addresses consist of an [`IPv6` address], a 16-bit port number, as well
85
80
/// as fields containing the traffic class, the flow label, and a scope identifier
86
81
/// (see [IETF RFC 2553, Section 3.3] for more details).
87
82
///
@@ -91,8 +86,7 @@ pub struct SocketAddrV4 {
91
86
/// system.
92
87
///
93
88
/// [IETF RFC 2553, Section 3.3]: https://tools.ietf.org/html/rfc2553#section-3.3
94
- /// [IPv6 address]: ../../std/net/struct.Ipv6Addr.html
95
- /// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
89
+ /// [`IPv6` address]: Ipv6Addr
96
90
///
97
91
/// # Examples
98
92
///
@@ -114,7 +108,7 @@ pub struct SocketAddrV6 {
114
108
impl SocketAddr {
115
109
/// Creates a new socket address from an [IP address] and a port number.
116
110
///
117
- /// [IP address]: ../../std/net/enum. IpAddr.html
111
+ /// [IP address]: IpAddr
118
112
///
119
113
/// # Examples
120
114
///
@@ -210,12 +204,12 @@ impl SocketAddr {
210
204
}
211
205
212
206
/// Returns [`true`] if the [IP address] in this `SocketAddr` is an
213
- /// [IPv4 address], and [`false`] otherwise.
207
+ /// [` IPv4` address], and [`false`] otherwise.
214
208
///
215
- /// [`true`]: ../../std/primitive.bool.html
209
+ /// [IP address]: IpAddr
210
+ /// [`IPv4` address]: IpAddr::V4
216
211
/// [`false`]: ../../std/primitive.bool.html
217
- /// [IP address]: ../../std/net/enum.IpAddr.html
218
- /// [IPv4 address]: ../../std/net/enum.IpAddr.html#variant.V4
212
+ /// [`true`]: ../../std/primitive.bool.html
219
213
///
220
214
/// # Examples
221
215
///
@@ -232,12 +226,12 @@ impl SocketAddr {
232
226
}
233
227
234
228
/// Returns [`true`] if the [IP address] in this `SocketAddr` is an
235
- /// [IPv6 address], and [`false`] otherwise.
229
+ /// [` IPv6` address], and [`false`] otherwise.
236
230
///
237
- /// [`true`]: ../../std/primitive.bool.html
231
+ /// [IP address]: IpAddr
232
+ /// [`IPv6` address]: IpAddr::V6
238
233
/// [`false`]: ../../std/primitive.bool.html
239
- /// [IP address]: ../../std/net/enum.IpAddr.html
240
- /// [IPv6 address]: ../../std/net/enum.IpAddr.html#variant.V6
234
+ /// [`true`]: ../../std/primitive.bool.html
241
235
///
242
236
/// # Examples
243
237
///
@@ -255,9 +249,9 @@ impl SocketAddr {
255
249
}
256
250
257
251
impl SocketAddrV4 {
258
- /// Creates a new socket address from an [IPv4 address] and a port number.
252
+ /// Creates a new socket address from an [` IPv4` address] and a port number.
259
253
///
260
- /// [IPv4 address]: ../../std/net/struct. Ipv4Addr.html
254
+ /// [` IPv4` address]: Ipv4Addr
261
255
///
262
256
/// # Examples
263
257
///
@@ -342,14 +336,14 @@ impl SocketAddrV4 {
342
336
}
343
337
344
338
impl SocketAddrV6 {
345
- /// Creates a new socket address from an [IPv6 address], a 16-bit port number,
339
+ /// Creates a new socket address from an [` IPv6` address], a 16-bit port number,
346
340
/// and the `flowinfo` and `scope_id` fields.
347
341
///
348
342
/// For more information on the meaning and layout of the `flowinfo` and `scope_id`
349
343
/// parameters, see [IETF RFC 2553, Section 3.3].
350
344
///
351
345
/// [IETF RFC 2553, Section 3.3]: https://tools.ietf.org/html/rfc2553#section-3.3
352
- /// [IPv6 address]: ../../std/net/struct. Ipv6Addr.html
346
+ /// [` IPv6` address]: Ipv6Addr
353
347
///
354
348
/// # Examples
355
349
///
@@ -461,9 +455,7 @@ impl SocketAddrV6 {
461
455
462
456
/// Changes the flow information associated with this socket address.
463
457
///
464
- /// See the [`flowinfo`] method's documentation for more details.
465
- ///
466
- /// [`flowinfo`]: #method.flowinfo
458
+ /// See [`SocketAddrV6::flowinfo`]'s documentation for more details.
467
459
///
468
460
/// # Examples
469
461
///
@@ -501,9 +493,7 @@ impl SocketAddrV6 {
501
493
502
494
/// Changes the scope ID associated with this socket address.
503
495
///
504
- /// See the [`scope_id`] method's documentation for more details.
505
- ///
506
- /// [`scope_id`]: #method.scope_id
496
+ /// See [`SocketAddrV6::scope_id`]'s documentation for more details.
507
497
///
508
498
/// # Examples
509
499
///
@@ -535,9 +525,6 @@ impl FromInner<c::sockaddr_in6> for SocketAddrV6 {
535
525
#[ stable( feature = "ip_from_ip" , since = "1.16.0" ) ]
536
526
impl From < SocketAddrV4 > for SocketAddr {
537
527
/// Converts a [`SocketAddrV4`] into a [`SocketAddr::V4`].
538
- ///
539
- /// [`SocketAddrV4`]: ../../std/net/struct.SocketAddrV4.html
540
- /// [`SocketAddr::V4`]: ../../std/net/enum.SocketAddr.html#variant.V4
541
528
fn from ( sock4 : SocketAddrV4 ) -> SocketAddr {
542
529
SocketAddr :: V4 ( sock4)
543
530
}
@@ -546,9 +533,6 @@ impl From<SocketAddrV4> for SocketAddr {
546
533
#[ stable( feature = "ip_from_ip" , since = "1.16.0" ) ]
547
534
impl From < SocketAddrV6 > for SocketAddr {
548
535
/// Converts a [`SocketAddrV6`] into a [`SocketAddr::V6`].
549
- ///
550
- /// [`SocketAddrV6`]: ../../std/net/struct.SocketAddrV6.html
551
- /// [`SocketAddr::V6`]: ../../std/net/enum.SocketAddr.html#variant.V6
552
536
fn from ( sock6 : SocketAddrV6 ) -> SocketAddr {
553
537
SocketAddr :: V6 ( sock6)
554
538
}
@@ -562,13 +546,6 @@ impl<I: Into<IpAddr>> From<(I, u16)> for SocketAddr {
562
546
/// and creates a [`SocketAddr::V6`] for a [`IpAddr::V6`].
563
547
///
564
548
/// `u16` is treated as port of the newly created [`SocketAddr`].
565
- ///
566
- /// [`IpAddr`]: ../../std/net/enum.IpAddr.html
567
- /// [`IpAddr::V4`]: ../../std/net/enum.IpAddr.html#variant.V4
568
- /// [`IpAddr::V6`]: ../../std/net/enum.IpAddr.html#variant.V6
569
- /// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
570
- /// [`SocketAddr::V4`]: ../../std/net/enum.SocketAddr.html#variant.V4
571
- /// [`SocketAddr::V6`]: ../../std/net/enum.SocketAddr.html#variant.V6
572
549
fn from ( pieces : ( I , u16 ) ) -> SocketAddr {
573
550
SocketAddr :: new ( pieces. 0 . into ( ) , pieces. 1 )
574
551
}
@@ -785,18 +762,11 @@ impl hash::Hash for SocketAddrV6 {
785
762
/// Addresses returned by the operating system that are not IP addresses are
786
763
/// silently ignored.
787
764
///
788
- /// [`FromStr`]: ../../std/str/trait.FromStr.html
789
- /// [`IpAddr`]: ../../std/net/enum.IpAddr.html
790
- /// [`Ipv4Addr`]: ../../std/net/struct.Ipv4Addr.html
791
- /// [`Ipv6Addr`]: ../../std/net/struct.Ipv6Addr.html
792
- /// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
793
- /// [`SocketAddrV4`]: ../../std/net/struct.SocketAddrV4.html
794
- /// [`SocketAddrV6`]: ../../std/net/struct.SocketAddrV6.html
795
- /// [`&str`]: ../../std/primitive.str.html
796
- /// [`TcpStream`]: ../../std/net/struct.TcpStream.html
797
- /// [`to_socket_addrs`]: #tymethod.to_socket_addrs
798
- /// [`UdpSocket`]: ../../std/net/struct.UdpSocket.html
799
- /// [`u16`]: ../../std/primitive.u16.html
765
+ /// [`FromStr`]: crate::str::FromStr
766
+ /// [`&str`]: str
767
+ /// [`TcpStream`]: crate::net::TcpStream
768
+ /// [`to_socket_addrs`]: ToSocketAddrs::to_socket_addrs
769
+ /// [`UdpSocket`]: crate::net::UdpSocket
800
770
///
801
771
/// # Examples
802
772
///
@@ -867,7 +837,7 @@ impl hash::Hash for SocketAddrV6 {
867
837
/// let stream = TcpStream::connect((Ipv4Addr::new(127, 0, 0, 1), 443));
868
838
/// ```
869
839
///
870
- /// [`TcpStream::connect`]: ../../std/ net/struct. TcpStream.html#method. connect
840
+ /// [`TcpStream::connect`]: crate:: net:: TcpStream:: connect
871
841
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
872
842
pub trait ToSocketAddrs {
873
843
/// Returned iterator over socket addresses which this type may correspond
0 commit comments