update to rust master

fixing usage of a Private trait as bounds for a public trait
This commit is contained in:
Sean McArthur
2014-09-24 19:43:24 -07:00
parent 67f2a87dc3
commit 3259f7dce9
3 changed files with 8 additions and 17 deletions

View File

@@ -6,14 +6,15 @@ use url::Url;
use method::{mod, Get, Post, Delete, Put, Patch, Head, Options};
use header::Headers;
use header::common::{mod, Host};
use net::{NetworkStream, HttpStream, WriteStatus, Fresh, Streaming};
use net::{NetworkStream, HttpStream, Fresh, Streaming};
use http::{HttpWriter, ThroughWriter, ChunkedWriter, SizedWriter, LINE_ENDING};
use version;
use {HttpResult, HttpUriError};
use client::Response;
/// A client request to a remote server.
pub struct Request<W: WriteStatus> {
pub struct Request<W> {
/// The target URI for this request.
pub url: Url,
@@ -25,7 +26,7 @@ pub struct Request<W: WriteStatus> {
method: method::Method,
}
impl<W: WriteStatus> Request<W> {
impl<W> Request<W> {
/// Read the Request headers.
#[inline]
pub fn headers(&self) -> &Headers { &self.headers }

View File

@@ -14,17 +14,6 @@ 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.

View File

@@ -10,11 +10,12 @@ use header;
use header::common;
use http::{CR, LF, LINE_ENDING, HttpWriter, ThroughWriter, ChunkedWriter, SizedWriter};
use status;
use net::{NetworkStream, WriteStatus, Fresh, Streaming};
use net::{NetworkStream, Fresh, Streaming};
use version;
/// The outgoing half for a Tcp connection, created by a `Server` and given to a `Handler`.
pub struct Response<W: WriteStatus> {
pub struct Response<W> {
/// The HTTP version of this response.
pub version: version::HttpVersion,
// Stream the Response is writing to, not accessible through UnwrittenResponse
@@ -25,7 +26,7 @@ pub struct Response<W: WriteStatus> {
headers: header::Headers
}
impl<W: WriteStatus> Response<W> {
impl<W> Response<W> {
/// The status of this response.
#[inline]
pub fn status(&self) -> status::StatusCode { self.status }