diff --git a/tokio-tls/src/lib.rs b/tokio-tls/src/lib.rs index e754c3ab585..1af689f9dff 100644 --- a/tokio-tls/src/lib.rs +++ b/tokio-tls/src/lib.rs @@ -155,6 +155,22 @@ impl TlsStream { let g = Guard(self); f(&mut (g.0).0) } + + /// Returns a shared reference to the inner stream. + pub fn get_ref(&self) -> &S + where + S: AsyncRead + AsyncWrite + Unpin, + { + &self.0.get_ref().inner + } + + /// Returns a mutable reference to the inner stream. + pub fn get_mut(&mut self) -> &mut S + where + S: AsyncRead + AsyncWrite + Unpin, + { + &mut self.0.get_mut().inner + } } impl AsyncRead for TlsStream