File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ pub use to_header_values::ToHeaderValues;
25
25
pub use values:: Values ;
26
26
27
27
/// A collection of HTTP Headers.
28
- #[ derive( Debug ) ]
28
+ #[ derive( Debug , Clone ) ]
29
29
pub struct Headers {
30
30
pub ( crate ) headers : HashMap < HeaderName , Vec < HeaderValue > > ,
31
31
}
Original file line number Diff line number Diff line change @@ -491,6 +491,22 @@ impl Request {
491
491
}
492
492
}
493
493
494
+ impl Clone for Request {
495
+ /// Clone the request, resolving the body to `Body::empty()` and removing extensions.
496
+ fn clone ( & self ) -> Self {
497
+ Request {
498
+ method : self . method . clone ( ) ,
499
+ url : self . url . clone ( ) ,
500
+ headers : self . headers . clone ( ) ,
501
+ version : self . version . clone ( ) ,
502
+ sender : self . sender . clone ( ) ,
503
+ receiver : self . receiver . clone ( ) ,
504
+ body : Body :: empty ( ) ,
505
+ local : TypeMap :: new ( ) ,
506
+ }
507
+ }
508
+ }
509
+
494
510
impl Read for Request {
495
511
#[ allow( missing_doc_code_examples) ]
496
512
fn poll_read (
Original file line number Diff line number Diff line change @@ -456,6 +456,21 @@ impl Response {
456
456
}
457
457
}
458
458
459
+ impl Clone for Response {
460
+ /// Clone the response, resolving the body to `Body::empty()` and removing extensions.
461
+ fn clone ( & self ) -> Self {
462
+ Self {
463
+ status : self . status . clone ( ) ,
464
+ headers : self . headers . clone ( ) ,
465
+ version : self . version . clone ( ) ,
466
+ sender : self . sender . clone ( ) ,
467
+ receiver : self . receiver . clone ( ) ,
468
+ body : Body :: empty ( ) ,
469
+ local : TypeMap :: new ( ) ,
470
+ }
471
+ }
472
+ }
473
+
459
474
impl Read for Response {
460
475
#[ allow( missing_doc_code_examples) ]
461
476
fn poll_read (
You can’t perform that action at this time.
0 commit comments