From da1518887ddc73b690f0ad57495c37251600fccf Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Fri, 9 Oct 2020 21:46:52 -0300 Subject: [PATCH] feat: getters for Status Code & Data Length Implements two methods on `Response` `struct`. 1. `status_code` 2. `data_length` To act as "Getters" for these private properties in case they are needed by the client. --- src/response.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/response.rs b/src/response.rs index 4eaf29a3e..ee0fdbc43 100644 --- a/src/response.rs +++ b/src/response.rs @@ -436,6 +436,16 @@ where Ok(()) } + + /// Retrieves the current value of the `Response` status code + pub fn status_code(&self) -> StatusCode { + self.status_code.clone() + } + + /// Retrieves the current value of the `Response` data length + pub fn data_length(&self) -> Option { + self.data_length + } } impl Response