Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify type returned when awaiting a oneshot::Receiver #5198

Merged
merged 2 commits into from Nov 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 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,7 @@ pub mod error {
use std::fmt;

/// Error returned by the `Future` implementation for `Receiver`.
/// This error is returned when the sender is dropped without sending.
Darksonn marked this conversation as resolved.
Show resolved Hide resolved
#[derive(Debug, Eq, PartialEq, Clone)]
pub struct RecvError(pub(super) ());

Expand Down