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