Skip to content

Commit

Permalink
feat: getters for Status Code & Data Length
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EstebanBorai committed Dec 29, 2020
1 parent 325af94 commit da15188
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/response.rs
Expand Up @@ -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<usize> {
self.data_length
}
}

impl<R> Response<R>
Expand Down

0 comments on commit da15188

Please sign in to comment.