refactor(lib): rename http_types to http
This commit is contained in:
@@ -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>;
|
||||
|
||||
@@ -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,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user