Skip to content

Commit 5a6ebdf

Browse files
committed
Add links to std::sync::mpsc docs rust-lang#29377
1 parent 5c94997 commit 5a6ebdf

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

Diff for: src/libstd/sync/mpsc/mod.rs

+25-15
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,50 @@
1313
//! This module provides message-based communication over channels, concretely
1414
//! defined among three types:
1515
//!
16-
//! * `Sender`
17-
//! * `SyncSender`
18-
//! * `Receiver`
16+
//! * [`Sender`]
17+
//! * [`SyncSender`]
18+
//! * [`Receiver`]
1919
//!
20-
//! A `Sender` or `SyncSender` is used to send data to a `Receiver`. Both
20+
//! A [`Sender`] or [`SyncSender`] is used to send data to a [`Receiver`]. Both
2121
//! senders are clone-able (multi-producer) such that many threads can send
2222
//! simultaneously to one receiver (single-consumer).
2323
//!
2424
//! These channels come in two flavors:
2525
//!
26-
//! 1. An asynchronous, infinitely buffered channel. The `channel()` function
26+
//! 1. An asynchronous, infinitely buffered channel. The [`channel()`] function
2727
//! will return a `(Sender, Receiver)` tuple where all sends will be
2828
//! **asynchronous** (they never block). The channel conceptually has an
2929
//! infinite buffer.
3030
//!
31-
//! 2. A synchronous, bounded channel. The `sync_channel()` function will return
32-
//! a `(SyncSender, Receiver)` tuple where the storage for pending messages
33-
//! is a pre-allocated buffer of a fixed size. All sends will be
31+
//! 2. A synchronous, bounded channel. The [`sync_channel()`] function will
32+
//! return a `(SyncSender, Receiver)` tuple where the storage for pending
33+
//! messages is a pre-allocated buffer of a fixed size. All sends will be
3434
//! **synchronous** by blocking until there is buffer space available. Note
35-
//! that a bound of 0 is allowed, causing the channel to become a
36-
//! "rendezvous" channel where each sender atomically hands off a message to
37-
//! a receiver.
35+
//! that a bound of 0 is allowed, causing the channel to become a "rendezvous"
36+
//! channel where each sender atomically hands off a message to a receiver.
37+
//!
38+
//! [`Sender`]: ../../../std/sync/mpsc/struct.Sender.html
39+
//! [`SyncSender`]: ../../../std/sync/mpsc/struct.SyncSender.html
40+
//! [`Receiver`]: ../../../std/sync/mpsc/struct.Receiver.html
41+
//! [`send`]: ../../../std/sync/mpsc/struct.Sender.html#method.send
42+
//! [`channel()`]: ../../../std/sync/mpsc/fn.channel.html
43+
//! [`sync_channel()`]: ../../../std/sync/mpsc/fn.sync_channel.html
3844
//!
3945
//! ## Disconnection
4046
//!
41-
//! The send and receive operations on channels will all return a `Result`
47+
//! The send and receive operations on channels will all return a [`Result`]
4248
//! indicating whether the operation succeeded or not. An unsuccessful operation
4349
//! is normally indicative of the other half of a channel having "hung up" by
4450
//! being dropped in its corresponding thread.
4551
//!
4652
//! Once half of a channel has been deallocated, most operations can no longer
47-
//! continue to make progress, so `Err` will be returned. Many applications will
48-
//! continue to `unwrap()` the results returned from this module, instigating a
49-
//! propagation of failure among threads if one unexpectedly dies.
53+
//! continue to make progress, so [`Err`] will be returned. Many applications
54+
//! will continue to [`unwrap()`] the results returned from this module,
55+
//! instigating a propagation of failure among threads if one unexpectedly dies.
56+
//!
57+
//! [`Result`]: ../../../std/result/enum.Result.html
58+
//! [`Err`]: ../../../std/result/enum.Result.html#variant.Err
59+
//! [`unwrap()`]: ../../../std/result/enum.Result.html#method.unwrap
5060
//!
5161
//! # Examples
5262
//!

0 commit comments

Comments
 (0)