From a1dfa14034a3e0c9103d00cde667ab1de3d26c1f Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 24 Oct 2016 09:17:40 -0700 Subject: [PATCH] Add methods to extract inner from EasyFramed --- src/easy.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/easy.rs b/src/easy.rs index cab11d003..47fd2b072 100644 --- a/src/easy.rs +++ b/src/easy.rs @@ -334,6 +334,21 @@ impl EasyFramed wr: Vec::with_capacity(8 * 1024), } } + + /// Returns a reference to the underlying I/O stream wrapped by `EasyFramed`. + pub fn get_ref(&self) -> &T { + &self.upstream + } + + /// Returns a mutable reference to the underlying I/O stream wrapped by `EasyFramed`. + pub fn get_mut(&mut self) -> &mut T { + &mut self.upstream + } + + /// Consumes the `EasyFramed`, returning its underlying I/O stream. + pub fn into_inner(self) -> T { + self.upstream + } } impl FramedIo for EasyFramed