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 @@ -486,6 +486,22 @@ impl Request {
486
486
}
487
487
}
488
488
489
+ impl Clone for Request {
490
+ /// Clone the request, resolving the body to `Body::empty()` and removing extensions.
491
+ fn clone ( & self ) -> Self {
492
+ Request {
493
+ method : self . method . clone ( ) ,
494
+ url : self . url . clone ( ) ,
495
+ headers : self . headers . clone ( ) ,
496
+ version : self . version . clone ( ) ,
497
+ sender : self . sender . clone ( ) ,
498
+ receiver : self . receiver . clone ( ) ,
499
+ body : Body :: empty ( ) ,
500
+ local : TypeMap :: new ( ) ,
501
+ }
502
+ }
503
+ }
504
+
489
505
impl Read for Request {
490
506
#[ allow( missing_doc_code_examples) ]
491
507
fn poll_read (
Original file line number Diff line number Diff line change @@ -451,6 +451,21 @@ impl Response {
451
451
}
452
452
}
453
453
454
+ impl Clone for Response {
455
+ /// Clone the response, resolving the body to `Body::empty()` and removing extensions.
456
+ fn clone ( & self ) -> Self {
457
+ Self {
458
+ status : self . status . clone ( ) ,
459
+ headers : self . headers . clone ( ) ,
460
+ version : self . version . clone ( ) ,
461
+ sender : self . sender . clone ( ) ,
462
+ receiver : self . receiver . clone ( ) ,
463
+ body : Body :: empty ( ) ,
464
+ local : TypeMap :: new ( ) ,
465
+ }
466
+ }
467
+ }
468
+
454
469
impl Read for Response {
455
470
#[ allow( missing_doc_code_examples) ]
456
471
fn poll_read (
You can’t perform that action at this time.
0 commit comments