@@ -14,14 +14,12 @@ use status;
14
14
use net:: { Fresh , Streaming } ;
15
15
use version;
16
16
17
- pub type InternalWriter < ' a > = & ' a mut ( Writer + ' a ) ;
18
-
19
17
/// The outgoing half for a Tcp connection, created by a `Server` and given to a `Handler`.
20
18
pub struct Response < ' a , W = Fresh > {
21
19
/// The HTTP version of this response.
22
20
pub version : version:: HttpVersion ,
23
21
// Stream the Response is writing to, not accessible through UnwrittenResponse
24
- body : HttpWriter < InternalWriter < ' a > > ,
22
+ body : HttpWriter < & ' a mut ( Writer + ' a ) > ,
25
23
// The status code for the request.
26
24
status : status:: StatusCode ,
27
25
// The outgoing headers on this response.
@@ -38,7 +36,7 @@ impl<'a, W> Response<'a, W> {
38
36
39
37
/// Construct a Response from its constituent parts.
40
38
pub fn construct ( version : version:: HttpVersion ,
41
- body : HttpWriter < InternalWriter < ' a > > ,
39
+ body : HttpWriter < & ' a mut ( Writer + ' a ) > ,
42
40
status : status:: StatusCode ,
43
41
headers : header:: Headers ) -> Response < ' a , Fresh > {
44
42
Response {
@@ -50,15 +48,15 @@ impl<'a, W> Response<'a, W> {
50
48
}
51
49
52
50
/// Deconstruct this Response into its constituent parts.
53
- pub fn deconstruct ( self ) -> ( version:: HttpVersion , HttpWriter < InternalWriter < ' a > > ,
51
+ pub fn deconstruct ( self ) -> ( version:: HttpVersion , HttpWriter < & ' a mut ( Writer + ' a ) > ,
54
52
status:: StatusCode , header:: Headers ) {
55
53
( self . version , self . body , self . status , self . headers )
56
54
}
57
55
}
58
56
59
57
impl < ' a > Response < ' a , Fresh > {
60
58
/// Creates a new Response that can be used to write to a network stream.
61
- pub fn new ( stream : InternalWriter < ' a > ) -> Response < ' a , Fresh > {
59
+ pub fn new ( stream : & ' a mut ( Writer + ' a ) ) -> Response < ' a , Fresh > {
62
60
Response {
63
61
status : status:: StatusCode :: Ok ,
64
62
version : version:: HttpVersion :: Http11 ,
0 commit comments