From 23f04c4f38ee3ff47eafb2f26338e2e6561f591e Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Wed, 25 Sep 2019 08:50:45 +0200 Subject: [PATCH] Add remaining getter methods from private head field --- awc/src/request.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/awc/src/request.rs b/awc/src/request.rs index d597a1638..a90cf60b2 100644 --- a/awc/src/request.rs +++ b/awc/src/request.rs @@ -96,7 +96,7 @@ impl ClientRequest { self } - /// Get HTTP URI of request + /// Get HTTP URI of request. pub fn get_uri(&self) -> &Uri { &self.head.uri } @@ -132,6 +132,16 @@ impl ClientRequest { self } + /// Get HTTP version of this request. + pub fn get_version(&self) -> &Version { + &self.head.version + } + + /// Get peer address of this request. + pub fn get_peer_addr(&self) -> &Option { + &self.head.peer_addr + } + #[inline] /// Returns request's headers. pub fn headers(&self) -> &HeaderMap {