refactor(lib): rename http_types to http

This commit is contained in:
Sean McArthur
2017-09-29 18:12:55 -07:00
parent 6f71932015
commit 9c80fdbb9e
12 changed files with 97 additions and 97 deletions

View File

@@ -1,7 +1,7 @@
use std::io::{Error as IoError};
use futures::{Future, Poll};
use http_types;
use http;
use tokio_service::{NewService, Service};
use error::Error;
@@ -17,7 +17,7 @@ pub struct CompatFuture<F> {
}
impl<F, Bd> Future for CompatFuture<F>
where F: Future<Item=http_types::Response<Bd>, Error=Error>
where F: Future<Item=http::Response<Bd>, Error=Error>
{
type Item = Response<Bd>;
type Error = Error;
@@ -41,7 +41,7 @@ pub fn service<S>(service: S) -> CompatService<S> {
}
impl<S, Bd> Service for CompatService<S>
where S: Service<Request=http_types::Request<Body>, Response=http_types::Response<Bd>, Error=Error>
where S: Service<Request=http::Request<Body>, Response=http::Response<Bd>, Error=Error>
{
type Request = Request;
type Response = Response<Bd>;
@@ -68,7 +68,7 @@ pub fn new_service<S>(new_service: S) -> NewCompatService<S> {
}
impl<S, Bd> NewService for NewCompatService<S>
where S: NewService<Request=http_types::Request<Body>, Response=http_types::Response<Bd>, Error=Error>
where S: NewService<Request=http::Request<Body>, Response=http::Response<Bd>, Error=Error>
{
type Request = Request;
type Response = Response<Bd>;

View File

@@ -22,7 +22,7 @@ use futures::{Future, Stream, Poll, Async, Sink, StartSend, AsyncSink};
use futures::future::Map;
#[cfg(feature = "compat")]
use http_types;
use http;
use tokio_io::{AsyncRead, AsyncWrite};
use tokio::reactor::{Core, Handle, Timeout};
@@ -129,7 +129,7 @@ impl<B: AsRef<[u8]> + 'static> Http<B> {
/// See `Http::bind`.
#[cfg(feature = "compat")]
pub fn bind_compat<S, Bd>(&self, addr: &SocketAddr, new_service: S) -> ::Result<Server<compat::NewCompatService<S>, Bd>>
where S: NewService<Request = http_types::Request<Body>, Response = http_types::Response<Bd>, Error = ::Error> +
where S: NewService<Request = http::Request<Body>, Response = http::Response<Bd>, Error = ::Error> +
Send + Sync + 'static,
Bd: Stream<Item=B, Error=::Error>,
{
@@ -174,7 +174,7 @@ impl<B: AsRef<[u8]> + 'static> Http<B> {
io: I,
remote_addr: SocketAddr,
service: S)
where S: Service<Request = http_types::Request<Body>, Response = http_types::Response<Bd>, Error = ::Error> + 'static,
where S: Service<Request = http::Request<Body>, Response = http::Response<Bd>, Error = ::Error> + 'static,
Bd: Stream<Item=B, Error=::Error> + 'static,
I: AsyncRead + AsyncWrite + 'static,
{