diff --git a/src/client/pool.rs b/src/client/pool.rs index ca80cd2401..45de8b3de0 100644 --- a/src/client/pool.rs +++ b/src/client/pool.rs @@ -144,6 +144,11 @@ impl PooledStream { pub fn into_inner(mut self) -> S { self.inner.take().expect("PooledStream lost its inner stream").stream } + + /// Gets a borrowed reference to the underlying stream. + pub fn get_ref(&self) -> &S { + &self.inner.as_ref().expect("PooledStream lost its inner stream").stream + } } #[derive(Debug)]