feat(hyper): switch to std::io, std::net, and std::path.

All instances of `old_io` and `old_path` were switched to use the new
shiny `std::io`, `std::net`, and `std::path` modules. This means that
`Request` and `Response` implement `Read` and `Write` now.

Because of the changes to `TcpListener`, this also takes the opportunity
to correct the method usage of `Server`. As with other
languages/frameworks, the server is first created with a handler, and
then a host/port is passed to a `listen` method. This reverses what
`Server` used to do.

Closes #347

BREAKING CHANGE: Check the docs. Everything was touched.
This commit is contained in:
Sean McArthur
2015-02-17 15:29:52 -08:00
parent 7235d3f74a
commit 0fd6fcd7c7
22 changed files with 641 additions and 639 deletions

View File

@@ -1,6 +1,6 @@
#![feature(core, collections, io, old_io, os, old_path,
#![feature(core, collections, io, net, os, path,
std_misc, box_syntax, unsafe_destructor)]
#![deny(missing_docs)]
#![cfg_attr(test, deny(missing_docs))]
#![cfg_attr(test, deny(warnings))]
#![cfg_attr(test, feature(alloc, test))]
@@ -140,7 +140,7 @@ extern crate log;
#[cfg(test)]
extern crate test;
pub use std::old_io::net::ip::{SocketAddr, IpAddr, Ipv4Addr, Ipv6Addr, Port};
pub use mimewrapper::mime;
pub use url::Url;
pub use client::Client;
@@ -150,7 +150,7 @@ pub use server::Server;
use std::error::{Error, FromError};
use std::fmt;
use std::old_io::IoError;
use std::io::Error as IoError;
use self::HttpError::{HttpMethodError, HttpUriError, HttpVersionError,
HttpHeaderError, HttpStatusError, HttpIoError};
@@ -164,7 +164,7 @@ macro_rules! todo(
macro_rules! inspect(
($name:expr, $value:expr) => ({
let v = $value;
debug!("inspect: {:?} = {:?}", $name, v);
trace!("inspect: {:?} = {:?}", $name, v);
v
})
);