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

@@ -3,6 +3,23 @@ use std::io::{IoResult, Stream, Listener, Acceptor};
use std::io::net::ip::{SocketAddr, Port};
use std::io::net::tcp::{TcpStream, TcpListener, TcpAcceptor};
/// The write-status indicating headers have not been written.
pub struct Fresh;
/// The write-status indicating headers have been written.
pub struct Streaming;
/// The write-status of a Request
pub trait WriteStatus: Private {}
impl WriteStatus for Fresh {}
impl WriteStatus for Streaming {}
// Only Fresh and Streaming can be WriteStatus
#[doc(hidden)]
trait Private {}
impl Private for Fresh {}
impl Private for Streaming {}
/// An abstraction to listen for connections on a certain port.
pub trait NetworkListener<S: NetworkStream, A: NetworkAcceptor<S>>: Listener<S, A> {
/// Bind to a socket.