diff --git a/tokio-sync/src/mpsc/bounded.rs b/tokio-sync/src/mpsc/bounded.rs index 49734186a..d74317316 100644 --- a/tokio-sync/src/mpsc/bounded.rs +++ b/tokio-sync/src/mpsc/bounded.rs @@ -214,6 +214,13 @@ impl ::std::error::Error for SendError { // ===== impl TrySendError ===== +impl TrySendError { + /// Get the inner value. + pub fn into_inner(self) -> T { + self.value + } +} + impl fmt::Display for TrySendError { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { use std::error::Error; diff --git a/tokio-sync/src/mpsc/unbounded.rs b/tokio-sync/src/mpsc/unbounded.rs index 33419d4ac..957336517 100644 --- a/tokio-sync/src/mpsc/unbounded.rs +++ b/tokio-sync/src/mpsc/unbounded.rs @@ -136,6 +136,13 @@ impl ::std::error::Error for UnboundedSendError { // ===== impl TrySendError ===== +impl UnboundedTrySendError { + /// Get the inner value. + pub fn into_inner(self) -> T { + self.0 + } +} + impl fmt::Display for UnboundedTrySendError { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { use std::error::Error;