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

fix doc for std::sync::mpmc #135876

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions library/std/src/sync/mpmc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! infinite buffer.
//!
//! 2. A synchronous, bounded channel. The [`sync_channel`] function will
//! return a `(SyncSender, Receiver)` tuple where the storage for pending
//! return a `(Sender, Receiver)` tuple where the storage for pending
//! messages is a pre-allocated buffer of a fixed size. All sends will be
//! **synchronous** by blocking until there is buffer space available. Note
//! that a bound of 0 is allowed, causing the channel to become a "rendezvous"
Expand Down Expand Up @@ -360,9 +360,17 @@ impl<T> Sender<T> {
/// that a return value of [`Err`] means that the data will never be
/// received, but a return value of [`Ok`] does *not* mean that the data
/// will be received. It is possible for the corresponding receiver to
/// hang up immediately after this function returns [`Ok`].
/// hang up immediately after this function returns [`Ok`]. However, if
/// the channel is zero-capacity, it acts as a rendezvous channel and a
/// return value of [`Ok`] means that the data has been received.
///
/// This method will never block the current thread.
/// If the channel is full and not disconnected, this call will block until
/// the send operation can proceed. If the channel becomes disconnected,
/// this call will wake up and return an error. The returned error contains
/// the original message.
///
/// If called on a zero-capacity channel, this method will wait for a receive
/// operation to appear on the other side of the channel.
///
/// # Examples
///
Expand Down Expand Up @@ -650,7 +658,7 @@ impl<T> fmt::Debug for Sender<T> {
}

/// The receiving half of Rust's [`channel`] (or [`sync_channel`]) type.
/// Different threads can share this [`Sender`] by cloning it.
/// Different threads can share this [`Receiver`] by cloning it.
///
/// Messages sent to the channel can be retrieved using [`recv`].
///
Expand Down
Loading