]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/sync/mpsc/mod.rs
Rollup merge of #106835 - compiler-errors:new-solver-gat-rebase-oops, r=lcnr
[rust.git] / library / std / src / sync / mpsc / mod.rs
index adb488d4378f0391140e6eadf604603720f8776f..6e3c28f10bb1ba9e31298fa90d34b54029ae32bd 100644 (file)
@@ -738,6 +738,15 @@ pub fn send(&self, t: T) -> Result<(), SendError<T>> {
     pub fn try_send(&self, t: T) -> Result<(), TrySendError<T>> {
         self.inner.try_send(t)
     }
+
+    // Attempts to send for a value on this receiver, returning an error if the
+    // corresponding channel has hung up, or if it waits more than `timeout`.
+    //
+    // This method is currently private and only used for tests.
+    #[allow(unused)]
+    fn send_timeout(&self, t: T, timeout: Duration) -> Result<(), mpmc::SendTimeoutError<T>> {
+        self.inner.send_timeout(t, timeout)
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]