feat(http): add get_ref methods to Encoder and Decoder

This commit is contained in:
Sean McArthur
2016-06-14 07:52:18 -07:00
parent 42ebb768c3
commit 766377cfe7
4 changed files with 36 additions and 7 deletions

View File

@@ -53,11 +53,6 @@ pub enum Blocked {
Write,
}
impl Transport for HttpStream {
fn take_socket_error(&mut self) -> io::Result<()> {
self.0.take_socket_error()
}
}
/// Accepts sockets asynchronously.
pub trait Accept: Evented {
@@ -73,6 +68,12 @@ pub trait Accept: Evented {
#[derive(Debug)]
pub struct HttpStream(pub TcpStream);
impl Transport for HttpStream {
fn take_socket_error(&mut self) -> io::Result<()> {
self.0.take_socket_error()
}
}
impl Read for HttpStream {
#[inline]
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {