Moved WriteStatus, Fresh, and Streaming in to the net module.

This commit is contained in:
Jonathan Reem
2014-09-10 15:20:14 -07:00
committed by Sean McArthur
parent d5c6f33c34
commit 4115c0e219
5 changed files with 26 additions and 37 deletions

View File

@@ -6,11 +6,12 @@ use intertwine::{Intertwine, Intertwined};
use macceptor::MoveAcceptor;
pub use self::request::Request;
pub use self::response::{Response, Fresh, Streaming};
use net::{NetworkListener, NetworkAcceptor, NetworkStream, HttpAcceptor, HttpListener, HttpStream};
pub use self::response::Response;
use {HttpResult};
use net::{NetworkListener, NetworkAcceptor, NetworkStream,
HttpAcceptor, HttpListener, HttpStream,
Fresh};
pub mod request;
pub mod response;

View File

@@ -10,21 +10,9 @@ use header;
use header::common;
use http::{CR, LF, LINE_ENDING};
use status;
use net::NetworkStream;
use net::{NetworkStream, WriteStatus, Fresh, Streaming};
use version;
/// Phantom type indicating Headers and StatusCode have not been written.
pub struct Fresh;
/// Phantom type indicating Headers and StatusCode have been written.
pub struct Streaming;
/// The status of a Response, indicating if the headers and status have been written.
pub trait WriteStatus {}
impl WriteStatus for Streaming {}
impl WriteStatus for Fresh {}
/// The outgoing half for a Tcp connection, created by a `Server` and given to a `Handler`.
pub struct Response<W: WriteStatus> {
/// The HTTP version of this response.