mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
Add methods to extract inner from EasyFramed
This commit is contained in:
parent
37a2bed4cf
commit
a1dfa14034
15
src/easy.rs
15
src/easy.rs
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user