summaryrefslogtreecommitdiff
path: root/spider/src/http_method.rs
diff options
context:
space:
mode:
authorAndrew <saintruler@gmail.com>2021-02-18 19:48:06 +0400
committerAndrew <saintruler@gmail.com>2021-02-18 19:48:06 +0400
commit0a1d8409e49343427d26c4ddf0bf56d5b3e7b7d5 (patch)
tree9654645e0c74af2cf834ac4f1d7d68ca219a57e6 /spider/src/http_method.rs
parent9b69d6460e91244bfd77d8ea77c13d21d9050e4c (diff)
Renamed spider package to spider_server
Diffstat (limited to 'spider/src/http_method.rs')
-rw-r--r--spider/src/http_method.rs39
1 files changed, 0 insertions, 39 deletions
diff --git a/spider/src/http_method.rs b/spider/src/http_method.rs
deleted file mode 100644
index 814c93b..0000000
--- a/spider/src/http_method.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-use std::fmt;
-
-#[derive(PartialEq)]
-pub enum HttpMethod {
- GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH
-}
-
-impl fmt::Display for HttpMethod {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- match *self {
- HttpMethod::GET => write!(f, "GET"),
- HttpMethod::HEAD => write!(f, "HEAD"),
- HttpMethod::POST => write!(f, "POST"),
- HttpMethod::PUT => write!(f, "PUT"),
- HttpMethod::DELETE => write!(f, "DELETE"),
- HttpMethod::CONNECT => write!(f, "CONNECT"),
- HttpMethod::OPTIONS => write!(f, "OPTIONS"),
- HttpMethod::TRACE => write!(f, "TRACE"),
- HttpMethod::PATCH => write!(f, "PATCH"),
- }
- }
-}
-
-impl HttpMethod {
- pub fn parse(s: String) -> Option<HttpMethod> {
- match &*s {
- "GET" => Some(HttpMethod::GET),
- "HEAD" => Some(HttpMethod::HEAD),
- "POST" => Some(HttpMethod::POST),
- "PUT" => Some(HttpMethod::PUT),
- "DELETE" => Some(HttpMethod::DELETE),
- "CONNECT" => Some(HttpMethod::CONNECT),
- "OPTIONS" => Some(HttpMethod::OPTIONS),
- "TRACE" => Some(HttpMethod::TRACE),
- "PATCH" => Some(HttpMethod::PATCH),
- _ => None
- }
- }
-}