summaryrefslogtreecommitdiff
path: root/src/http/method.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/method.rs')
-rw-r--r--src/http/method.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/http/method.rs b/src/http/method.rs
index 55cea65..cecafbf 100644
--- a/src/http/method.rs
+++ b/src/http/method.rs
@@ -1,4 +1,4 @@
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, Hash, Eq, PartialEq)]
pub enum Method {
Get,
Head,
@@ -26,5 +26,19 @@ impl Method {
_ => None
}
}
+
+ pub fn deserialize(&self) -> &str {
+ match self {
+ Method::Get => "GET",
+ Method::Head => "HEAD",
+ Method::Post => "POST",
+ Method::Put => "PUT",
+ Method::Delete => "DELETE",
+ Method::Connect => "CONNECT",
+ Method::Options => "OPTIONS",
+ Method::Trace => "TRACE",
+ Method::Patch => "PATCH",
+ }
+ }
}