Skip to content

Commit 169facf

Browse files
committed
added missing links in std::net TCP docs
part of #29363
1 parent 7dd4e2d commit 169facf

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/libstd/net/tcp.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,15 @@ impl TcpStream {
8383
/// Opens a TCP connection to a remote host.
8484
///
8585
/// `addr` is an address of the remote host. Anything which implements
86-
/// `ToSocketAddrs` trait can be supplied for the address; see this trait
86+
/// [`ToSocketAddrs`] trait can be supplied for the address; see this trait
8787
/// documentation for concrete examples.
88-
/// In case `ToSocketAddrs::to_socket_addrs()` returns more than one entry,
88+
/// In case [`ToSocketAddrs::to_socket_addrs()`] returns more than one entry,
8989
/// then the first valid and reachable address is used.
9090
///
91+
/// [`ToSocketAddrs`]: ../../std/net/trait.ToSocketAddrs.html
92+
/// [`ToSocketAddrs::to_socket_addrs()`]:
93+
/// ../../std/net/trait.ToSocketAddrs.html#tymethod.to_socket_addrs
94+
///
9195
/// # Examples
9296
///
9397
/// ```no_run
@@ -494,11 +498,14 @@ impl TcpListener {
494498
///
495499
/// Binding with a port number of 0 will request that the OS assigns a port
496500
/// to this listener. The port allocated can be queried via the
497-
/// `local_addr` method.
501+
/// [`local_addr`] method.
498502
///
499-
/// The address type can be any implementor of `ToSocketAddrs` trait. See
503+
/// The address type can be any implementor of [`ToSocketAddrs`] trait. See
500504
/// its documentation for concrete examples.
501505
///
506+
/// [`local_addr`]: #method.local_addr
507+
/// [`ToSocketAddrs`]: ../../std/net/trait.ToSocketAddrs.html
508+
///
502509
/// # Examples
503510
///
504511
/// ```no_run
@@ -529,10 +536,12 @@ impl TcpListener {
529536

530537
/// Creates a new independently owned handle to the underlying socket.
531538
///
532-
/// The returned `TcpListener` is a reference to the same socket that this
539+
/// The returned [`TcpListener`] is a reference to the same socket that this
533540
/// object references. Both handles can be used to accept incoming
534541
/// connections and options set on one listener will affect the other.
535542
///
543+
/// [`TcpListener`]: ../../std/net/struct.TcpListener.html
544+
///
536545
/// # Examples
537546
///
538547
/// ```no_run
@@ -549,9 +558,11 @@ impl TcpListener {
549558
/// Accept a new incoming connection from this listener.
550559
///
551560
/// This function will block the calling thread until a new TCP connection
552-
/// is established. When established, the corresponding `TcpStream` and the
561+
/// is established. When established, the corresponding [`TcpStream`] and the
553562
/// remote peer's address will be returned.
554563
///
564+
/// [`TcpStream`]: ../../std/net/struct.TcpStream.html
565+
///
555566
/// # Examples
556567
///
557568
/// ```no_run

0 commit comments

Comments
 (0)