From e52f80df5a114844d239561218112a650067f006 Mon Sep 17 00:00:00 2001 From: luben karavelov Date: Mon, 11 Feb 2019 18:45:55 +0000 Subject: [PATCH] feat(server): add `into_inner` to `AddrStream` (#1762) It consumes the `AddrStream` and returns the underlying TcpStream. --- src/server/tcp.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/tcp.rs b/src/server/tcp.rs index efab9619bc..48143bac60 100644 --- a/src/server/tcp.rs +++ b/src/server/tcp.rs @@ -219,6 +219,12 @@ mod addr_stream { pub fn remote_addr(&self) -> SocketAddr { self.remote_addr } + + /// Consumes the AddrStream and returns the underlying IO object + #[inline] + pub fn into_inner(self) -> TcpStream { + self.inner + } } impl Read for AddrStream {