1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use serde::Deserialize;
use serde::Serialize;

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum MethodPattern {
    Get,
    Connect,
    Post,
    Delete,
    Put,
    Patch,
    Options,
    Trace,
    Head,
}

impl ToString for MethodPattern{
    fn to_string(&self) -> String {
        match self {
            MethodPattern::Get => "Get".to_string(),
            MethodPattern::Connect => "Connect".to_string(),
            MethodPattern::Post => "Post".to_string(),
            MethodPattern::Delete => "Delete".to_string(),
            MethodPattern::Put => "Put".to_string(),
            MethodPattern::Patch => "Patch".to_string(),
            MethodPattern::Options => "Options".to_string(),
            MethodPattern::Trace => "Trace".to_string(),
            MethodPattern::Head => "Head".to_string(),
        }
    }
}