http_constant/common/
const.rs1use crate::*;
2
3pub const SPACE: &str = " ";
8
9pub const SPACE_U8: u8 = SPACE.as_bytes()[0];
14
15pub const TAB: &str = "\t";
20
21pub const TAB_U8: u8 = TAB.as_bytes()[0];
26
27pub const BR: &str = "\n";
32
33pub const BR_BYTES: &[u8] = BR.as_bytes();
35
36pub const COLON_SPACE: &str = ": ";
41
42pub const COLON_SPACE_BYTES: &[u8] = COLON_SPACE.as_bytes();
47
48pub const COLON_SPACE_SYMBOL: &str = ":";
53
54pub const QUERY_SYMBOL: &str = "?";
56
57pub const HASH_SYMBOL: &str = "#";
59
60pub const EMPTY_STR: &str = "";
62
63pub const DEFAULT_HOST: &str = "0.0.0.0";
65
66pub const DEFAULT_WEB_PORT: usize = 80;
68
69pub const HTTP_BR: &str = "\r\n";
71
72pub const HTTP_BR_BYTES: &[u8] = HTTP_BR.as_bytes();
74
75pub const HTTP_DOUBLE_BR: &str = "\r\n\r\n";
77
78pub const HTTP_DOUBLE_BR_BYTES: &[u8] = HTTP_DOUBLE_BR.as_bytes();
80
81pub const DEFAULT_HTTP_PATH: &str = "/";
83
84pub const DEFAULT_HTTP_PATH_BYTES: &[u8] = DEFAULT_HTTP_PATH.as_bytes();
86
87pub const AND: &str = "&";
89
90pub const AND_BYTES: &[u8] = AND.as_bytes();
92
93pub const EQUAL: &str = "=";
95
96pub const EQUAL_BYTES: &[u8] = EQUAL.as_bytes();
98
99pub const ZERO_STR: &str = "0";
101
102pub const ZERO_STR_BYTES: &[u8] = ZERO_STR.as_bytes();
104
105pub const DEFAULT_BUFFER_SIZE: usize = 4096;
107
108pub const DEFAULT_MAX_REDIRECT_TIMES: usize = 8;
110
111pub const DEFAULT_TIMEOUT: u64 = u64::MAX;
113
114pub const POINT: &str = ".";
116
117pub const ROOT_PATH: &str = "/";
119
120pub const SEMICOLON: &str = ";";
122
123pub const SEMICOLON_SPACE: &str = "; ";
125
126pub const GUID: &[u8; 36] = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
128
129pub const HASH_STATE: [u32; 5] = [
131 0x67452301u32,
132 0xEFCDAB89,
133 0x98BADCFE,
134 0x10325476,
135 0xC3D2E1F0,
136];
137
138pub const BASE64_CHARSET_TABLE: &[u8] =
140 b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
141
142pub const MAX_FRAME_SIZE: usize = 65535;
144
145pub const MAX_UTF8_ATTEMPTS: usize = 4;
147
148pub const DEFAULT_SOCKET_ADDR: SocketAddr =
150 SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(0, 0, 0, 0), 0));
151
152pub const SOCKET_ADDR_127_0_0_1: SocketAddr =
154 SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 0));
155
156pub const HYPERLANE: &str = "hyperlane";
158
159pub const HYPERLANE_PASCAL_CASE: &str = "Hyperlane";
161
162pub const DEFAULT_INNER_PRINT: bool = true;
164
165pub const DEFAULT_INNER_LOG: bool = true;
167
168pub const DEFAULT_NODELAY: bool = false;
170
171pub const DEFAULT_LINGER: Option<Duration> = None;
173
174pub const DEFAULT_TTI: Option<u32> = None;
176
177pub const WARNING: &str = "warning";
179
180pub const SUCCESS: &str = "success";
182
183pub const FAIL: &str = "fail";
185
186pub const ERROR: &str = "error";
188
189pub const INFO: &str = "info";
191
192pub const DEBUG: &str = "debug";
194
195pub const PLAIN: &str = "plain";
197
198pub const BINARY: &str = "binary";