mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
tokio: remove documentation stating Receiver
is clone-able. (#2037)
* tokio: remove documentation stating `Receiver` is clone-able. The documentation for `broadcast` stated that both `Sender` and `Receiver` are clonable. This isn't the case: `Receiver`s cannot be cloned (and shouldn't be cloned). In addition, mention that `Receiver` is `Sync`, and mention that both `Receiver` and `Sender` are `Send`. Fixes: #2032 * Clarify that Sender and Receiver are only Send and Sync if T is Send or Sync.
This commit is contained in:
parent
32e15b3a24
commit
84ff73e687
@ -2,8 +2,9 @@
|
||||
//! all consumers.
|
||||
//!
|
||||
//! A [`Sender`] is used to broadcast values to **all** connected [`Receiver`]
|
||||
//! values. Both [`Sender`] and [`Receiver`] handles are clone-able, allowing
|
||||
//! concurrent send and receive actions. Additionally, [`Sender`] is `Sync`.
|
||||
//! values. [`Sender`] handles are clone-able, allowing concurrent send and
|
||||
//! receive actions. [`Sender`] and [`Receiver`] are both `Send` and `Sync` as
|
||||
//! long as `T` is also `Send` or `Sync` respectively.
|
||||
//!
|
||||
//! When a value is sent, **all** [`Receiver`] handles are notified and will
|
||||
//! receive the value. The value is stored once inside the channel and cloned on
|
||||
|
Loading…
x
Reference in New Issue
Block a user