diff options
| author | Fuwn <[email protected]> | 2022-05-18 02:24:43 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-05-18 02:24:43 +0000 |
| commit | 5380404d16f432547b3804655399268a6763bb44 (patch) | |
| tree | dc6d83e15bd78816f40b5c2554bf58a12587ee76 /src | |
| parent | feat(meta): add getters (diff) | |
| download | germ-5380404d16f432547b3804655399268a6763bb44.tar.xz germ-5380404d16f432547b3804655399268a6763bb44.zip | |
feat(respones): add getters
Diffstat (limited to 'src')
| -rw-r--r-- | src/request/response.rs | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/request/response.rs b/src/request/response.rs index e96cee0..5e1f436 100644 --- a/src/request/response.rs +++ b/src/request/response.rs @@ -22,11 +22,11 @@ use crate::request::Status; #[derive(Debug)] pub struct Response { - pub status: Status, - pub meta: String, - pub content: Option<String>, - pub size: usize, - pub suite: Option<SupportedCipherSuite>, + status: Status, + meta: String, + content: Option<String>, + size: usize, + suite: Option<SupportedCipherSuite>, } impl Response { pub(super) fn new(data: &[u8], suite: Option<SupportedCipherSuite>) -> Self { @@ -53,4 +53,19 @@ impl Response { suite, } } + + #[must_use] + pub const fn status(&self) -> &Status { &self.status } + + #[must_use] + pub fn meta(&self) -> &str { &self.meta } + + #[must_use] + pub const fn content(&self) -> &Option<String> { &self.content } + + #[must_use] + pub const fn size(&self) -> &usize { &self.size } + + #[must_use] + pub const fn suite(&self) -> &Option<SupportedCipherSuite> { &self.suite } } |