micro_http: add getters for Response body & status
@@ -3,6 +3,7 @@ use common::{Body, Version};
use headers::{Header, Headers, MediaType};
#[allow(dead_code)]
+#[derive(Clone, Copy, PartialEq)]
pub enum StatusCode {
OK,
BadRequest,
@@ -85,6 +86,14 @@ impl Response {
return response;
}
+
+ pub fn status(&self) -> StatusCode {
+ self.status_line.status_code
+ }
+
+ pub fn body(&self) -> Option<Body> {
+ self.body.clone()
+ }
}
#[cfg(test)]
