diff --git a/src/server/mod.rs b/src/server/mod.rs index 2d213669..d61ea21b 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -176,6 +176,7 @@ impl ServerProto for Http type Transport = __ProtoTransport; type BindTransport = __ProtoBindTransport; + #[inline] fn bind_transport(&self, io: T) -> Self::BindTransport { let ka = if self.keep_alive { http::KA::Busy @@ -195,6 +196,7 @@ impl Sink for __ProtoTransport type SinkItem = Frame<__ProtoResponse, B, ::Error>; type SinkError = io::Error; + #[inline] fn start_send(&mut self, item: Self::SinkItem) -> StartSend { let item = match item { @@ -221,10 +223,12 @@ impl Sink for __ProtoTransport } } + #[inline] fn poll_complete(&mut self) -> Poll<(), io::Error> { self.0.poll_complete() } + #[inline] fn close(&mut self) -> Poll<(), io::Error> { self.0.close() } @@ -237,6 +241,7 @@ impl Stream for __ProtoTransport type Item = Frame<__ProtoRequest, http::Chunk, ::Error>; type Error = io::Error; + #[inline] fn poll(&mut self) -> Poll, io::Error> { let item = match try_ready!(self.0.poll()) { Some(item) => item, @@ -257,10 +262,12 @@ impl Transport for __ProtoTransport where T: AsyncRead + AsyncWrite + 'static, B: AsRef<[u8]> + 'static, { + #[inline] fn tick(&mut self) { self.0.tick() } + #[inline] fn cancel(&mut self) -> io::Result<()> { self.0.cancel() } @@ -272,12 +279,14 @@ impl Future for __ProtoBindTransport type Item = __ProtoTransport; type Error = io::Error; + #[inline] fn poll(&mut self) -> Poll<__ProtoTransport, io::Error> { self.inner.poll().map(|a| a.map(__ProtoTransport)) } } impl From> for Request { + #[inline] fn from(message: Message<__ProtoRequest, http::TokioBody>) -> Request { let (head, body) = match message { Message::WithoutBody(head) => (head.0, http::Body::empty()), @@ -288,6 +297,7 @@ impl From> for Request { } impl Into> for Response { + #[inline] fn into(self) -> Message<__ProtoResponse, B> { let (head, body) = response::split(self); if let Some(body) = body { @@ -315,6 +325,7 @@ impl Service for HttpService type Error = ::Error; type Future = Map) -> Message<__ProtoResponse, B>>; + #[inline] fn call(&self, message: Self::Request) -> Self::Future { let (head, body) = match message { Message::WithoutBody(head) => (head.0, http::Body::empty()),