warn of possible race condition in channel is_disconnected doc

This commit is contained in:
LevitatingBusinessMan (Rein Fernhout)
2026-02-28 19:52:50 +01:00
parent 7adb9bac0c
commit feef7b4eaf
2 changed files with 16 additions and 0 deletions
+8
View File
@@ -626,6 +626,10 @@ pub fn same_channel(&self, other: &Sender<T>) -> bool {
/// Returns `true` if the channel is disconnected.
///
/// Note that a return value of `false` does not guarantee the channel will
/// remain connected. The channel may be disconnected immediately after this method
/// returns, so a subsequent [`Sender::send`] may still fail with [`SendError`].
///
/// # Examples
///
/// ```
@@ -1375,6 +1379,10 @@ pub fn iter(&self) -> Iter<'_, T> {
/// Returns `true` if the channel is disconnected.
///
/// Note that a return value of `false` does not guarantee the channel will
/// remain connected. The channel may be disconnected immediately after this method
/// returns, so a subsequent [`Receiver::recv`] may still fail with [`RecvError`].
///
/// # Examples
///
/// ```
+8
View File
@@ -610,6 +610,10 @@ pub fn send(&self, t: T) -> Result<(), SendError<T>> {
/// Returns `true` if the channel is disconnected.
///
/// Note that a return value of `false` does not guarantee the channel will
/// remain connected. The channel may be disconnected immediately after this method
/// returns, so a subsequent [`Sender::send`] may still fail with [`SendError`].
///
/// # Examples
///
/// ```
@@ -1060,6 +1064,10 @@ pub fn try_iter(&self) -> TryIter<'_, T> {
/// Returns `true` if the channel is disconnected.
///
/// Note that a return value of `false` does not guarantee the channel will
/// remain connected. The channel may be disconnected immediately after this method
/// returns, so a subsequent [`Receiver::recv`] may still fail with [`RecvError`].
///
/// # Examples
///
/// ```