summaryrefslogtreecommitdiffstats
path: root/tokio/src/sync/oneshot.rs
diff options
context:
space:
mode:
authorAlice Ryhl <alice@ryhl.io>2020-06-17 22:14:09 +0200
committerGitHub <noreply@github.com>2020-06-17 22:14:09 +0200
commit3db22e29d19eba5b2a85e78f4ae8330d3edf6776 (patch)
tree0628a2eb32d39f56063da54a446d1aa9fb17c9a6 /tokio/src/sync/oneshot.rs
parente2adf2612d215d1925ef0dd9e2aa8cdd4c825abc (diff)
sync: documentation for mpsc channels (#2600)
Diffstat (limited to 'tokio/src/sync/oneshot.rs')
-rw-r--r--tokio/src/sync/oneshot.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tokio/src/sync/oneshot.rs b/tokio/src/sync/oneshot.rs
index 4b033ac3..54cd5b76 100644
--- a/tokio/src/sync/oneshot.rs
+++ b/tokio/src/sync/oneshot.rs
@@ -144,8 +144,11 @@ impl<T> Sender<T> {
/// Attempts to send a value on this channel, returning it back if it could
/// not be sent.
///
- /// The function consumes `self` as only one value may ever be sent on a
- /// one-shot channel.
+ /// This method consumes `self` as only one value may ever be sent on a oneshot
+ /// channel. It is not marked async because sending a message to an oneshot
+ /// channel never requires any form of waiting. Because of this, the `send`
+ /// method can be used in both synchronous and asynchronous code without
+ /// problems.
///
/// A successful send occurs when it is determined that the other end of the
/// channel has not hung up already. An unsuccessful send would be one where