@@ -83,11 +83,15 @@ impl TcpStream {
83
83
/// Opens a TCP connection to a remote host.
84
84
///
85
85
/// `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
87
87
/// 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,
89
89
/// then the first valid and reachable address is used.
90
90
///
91
+ /// [`ToSocketAddrs`]: ../../std/net/trait.ToSocketAddrs.html
92
+ /// [`ToSocketAddrs::to_socket_addrs()`]:
93
+ /// ../../std/net/trait.ToSocketAddrs.html#tymethod.to_socket_addrs
94
+ ///
91
95
/// # Examples
92
96
///
93
97
/// ```no_run
@@ -494,11 +498,14 @@ impl TcpListener {
494
498
///
495
499
/// Binding with a port number of 0 will request that the OS assigns a port
496
500
/// to this listener. The port allocated can be queried via the
497
- /// `local_addr` method.
501
+ /// [ `local_addr`] method.
498
502
///
499
- /// The address type can be any implementor of `ToSocketAddrs` trait. See
503
+ /// The address type can be any implementor of [ `ToSocketAddrs`] trait. See
500
504
/// its documentation for concrete examples.
501
505
///
506
+ /// [`local_addr`]: #method.local_addr
507
+ /// [`ToSocketAddrs`]: ../../std/net/trait.ToSocketAddrs.html
508
+ ///
502
509
/// # Examples
503
510
///
504
511
/// ```no_run
@@ -529,10 +536,12 @@ impl TcpListener {
529
536
530
537
/// Creates a new independently owned handle to the underlying socket.
531
538
///
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
533
540
/// object references. Both handles can be used to accept incoming
534
541
/// connections and options set on one listener will affect the other.
535
542
///
543
+ /// [`TcpListener`]: ../../std/net/struct.TcpListener.html
544
+ ///
536
545
/// # Examples
537
546
///
538
547
/// ```no_run
@@ -549,9 +558,11 @@ impl TcpListener {
549
558
/// Accept a new incoming connection from this listener.
550
559
///
551
560
/// 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
553
562
/// remote peer's address will be returned.
554
563
///
564
+ /// [`TcpStream`]: ../../std/net/struct.TcpStream.html
565
+ ///
555
566
/// # Examples
556
567
///
557
568
/// ```no_run
0 commit comments