Skip to content

Commit

Permalink
sync: specify return type of oneshot::Receiver in docs (#5198)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Nov 17, 2022
1 parent a668020 commit 1cbbcc9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tokio/src/sync/oneshot.rs
Expand Up @@ -227,7 +227,7 @@ pub struct Sender<T> {
/// [`channel`](fn@channel) function.
///
/// This channel has no `recv` method because the receiver itself implements the
/// [`Future`] trait. To receive a value, `.await` the `Receiver` object directly.
/// [`Future`] trait. To receive a `Result<T, `[`error::RecvError`]`>`, `.await` the `Receiver` object directly.
///
/// The `poll` method on the `Future` trait is allowed to spuriously return
/// `Poll::Pending` even if the message has been sent. If such a spurious
Expand Down Expand Up @@ -331,6 +331,8 @@ pub mod error {
use std::fmt;

/// Error returned by the `Future` implementation for `Receiver`.
///
/// This error is returned by the receiver when the sender is dropped without sending.
#[derive(Debug, Eq, PartialEq, Clone)]
pub struct RecvError(pub(super) ());

Expand Down

0 comments on commit 1cbbcc9

Please sign in to comment.