We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2790f60 commit 1014855Copy full SHA for 1014855
src/server/request.rs
@@ -32,7 +32,6 @@ pub struct Request<'a> {
32
33
34
impl<'a> Request<'a> {
35
-
36
/// Create a new Request, reading the StartLine and Headers so they are
37
/// immediately useful.
38
pub fn new(mut stream: &'a mut (Reader + 'a), addr: SocketAddr) -> HttpResult<Request<'a>> {
@@ -64,6 +63,14 @@ impl<'a> Request<'a> {
64
63
body: body
65
})
66
}
+
67
+ /// Deconstruct a Request into its constituent parts.
68
+ pub fn deconstruct(self) -> (SocketAddr, Method, Headers,
69
+ RequestUri, HttpVersion,
70
+ HttpReader<&'a mut (Reader + 'a)>,) {
71
+ (self.remote_addr, self.method, self.headers,
72
+ self.uri, self.version, self.body)
73
+ }
74
75
76
impl<'a> Reader for Request<'a> {
0 commit comments