@@ -32,6 +32,7 @@ type PiecesWithCookieStore = (
32
32
Option < redirect:: Policy > ,
33
33
( ) ,
34
34
NetworkScheme ,
35
+ Option < hyper2:: ext:: Protocol > ,
35
36
) ;
36
37
37
38
#[ cfg( feature = "cookies" ) ]
@@ -46,6 +47,7 @@ type PiecesWithCookieStore = (
46
47
Option < redirect:: Policy > ,
47
48
Option < Arc < dyn cookie:: CookieStore > > ,
48
49
NetworkScheme ,
50
+ Option < hyper2:: ext:: Protocol > ,
49
51
) ;
50
52
51
53
/// A request which can be executed with `Client::execute()`.
@@ -61,6 +63,7 @@ pub struct Request {
61
63
#[ cfg( feature = "cookies" ) ]
62
64
cookie_store : Option < Arc < dyn cookie:: CookieStore > > ,
63
65
network_scheme : NetworkSchemeBuilder ,
66
+ protocol : Option < hyper2:: ext:: Protocol > ,
64
67
}
65
68
66
69
/// A builder to construct the properties of a `Request`.
@@ -88,6 +91,7 @@ impl Request {
88
91
#[ cfg( feature = "cookies" ) ]
89
92
cookie_store : None ,
90
93
network_scheme : NetworkScheme :: builder ( ) ,
94
+ protocol : None ,
91
95
}
92
96
}
93
97
@@ -194,6 +198,12 @@ impl Request {
194
198
& mut self . version
195
199
}
196
200
201
+ /// Set the mutable reference to the protocol.
202
+ #[ inline]
203
+ pub fn protocol_mut ( & mut self ) -> & mut Option < hyper2:: ext:: Protocol > {
204
+ & mut self . protocol
205
+ }
206
+
197
207
/// Attempt to clone the request.
198
208
///
199
209
/// `None` is returned if the request can not be cloned, i.e. if the body is a stream.
@@ -232,6 +242,7 @@ impl Request {
232
242
#[ cfg( not( feature = "cookies" ) ) ]
233
243
( ) ,
234
244
self . network_scheme . build ( ) ,
245
+ self . protocol ,
235
246
)
236
247
}
237
248
}
@@ -824,6 +835,7 @@ where
824
835
#[ cfg( feature = "cookies" ) ]
825
836
cookie_store : None ,
826
837
network_scheme : NetworkScheme :: builder ( ) ,
838
+ protocol : None ,
827
839
} )
828
840
}
829
841
}
0 commit comments