rusty_cdk_core/shared/
http.rs

1pub enum HttpMethod {
2    Any,
3    Get,
4    Head,
5    Options,
6    Patch,
7    Post,
8    Put,
9    Delete
10}
11
12impl From<HttpMethod> for String {
13    fn from(value: HttpMethod) -> Self {
14        match value {
15            HttpMethod::Any => "*".to_string(),
16            HttpMethod::Get => "GET".to_string(),
17            HttpMethod::Head => "HEAD".to_string(),
18            HttpMethod::Options => "OPTIONS".to_string(),
19            HttpMethod::Patch => "PATCH".to_string(),
20            HttpMethod::Post => "POST".to_string(),
21            HttpMethod::Put => "PUT".to_string(),
22            HttpMethod::Delete => "DELETE".to_string()
23        }
24    }
25}
26
27pub enum Protocol {
28    Http,
29    Https,
30}
31
32impl From<Protocol> for String {
33    fn from(value: Protocol) -> Self {
34        match value {
35            Protocol::Http => "http".to_string(),
36            Protocol::Https => "https".to_string(),
37        }
38    }
39}