Add methods to extract inner from EasyFramed

This commit is contained in:
Michael Smith 2016-10-24 09:17:40 -07:00
parent 37a2bed4cf
commit a1dfa14034
No known key found for this signature in database
GPG Key ID: 8645BDF574E8F755

View File

@ -334,6 +334,21 @@ impl<T, P, S> EasyFramed<T, P, S>
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<T, P, S> FramedIo for EasyFramed<T, P, S>