rust_web_server/http/
mod.rs

1#[cfg(test)]
2mod tests;
3
4pub struct Version {
5    pub http_0_9: &'static str,
6    pub http_1_0: &'static str,
7    pub http_1_1: &'static str,
8    pub http_2_0: &'static str,
9}
10
11pub const VERSION: Version = Version {
12    http_0_9: "HTTP/0.9",
13    http_1_0: "HTTP/1.0",
14    http_1_1: "HTTP/1.1",
15    http_2_0: "HTTP/2.0",
16};
17
18pub struct HTTP;
19
20impl HTTP {
21    pub fn version_list() -> Vec<String> {
22        let version_0_9 = VERSION.http_0_9.to_string();
23        let version_1_0 = VERSION.http_1_0.to_string();
24        let version_1_1 = VERSION.http_1_1.to_string();
25        let version_2_0 = VERSION.http_2_0.to_string();
26
27
28        let list : Vec<String> = vec![
29            version_0_9,
30            version_1_0,
31            version_1_1,
32            version_2_0,
33        ];
34        list
35    }
36}