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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/// Default URL mount prefix served by [`crate::StaticFilesHook`].
pub const DEFAULT_STATIC_MOUNT_PREFIX: &str = "/";
/// Default directory index filename.
pub const DEFAULT_STATIC_INDEX_FILE: &str = "index.html";
/// Default `Cache-Control` header applied to served static files.
pub const DEFAULT_STATIC_CACHE_CONTROL: &str = "public, max-age=3600";
/// Default maximum total memory budget for the sharded hot-file cache (32 MiB).
pub const DEFAULT_STATIC_MAX_CACHE_BYTES: usize = 32 * 1024 * 1024;
/// Default maximum single file size eligible for in-memory hot caching (1 MiB).
pub const DEFAULT_STATIC_MAX_FILE_CACHE_BYTES: usize = 1024 * 1024;
/// Number of independent hot-file cache shards (`64`, power of two).
pub const STATIC_CACHE_SHARDS: usize = 64;
/// `Accept-Ranges` value advertising byte-range support.
pub const ACCEPT_RANGES_BYTES: &str = "bytes";
/// `Range` header unit prefix.
pub const RANGE_BYTES_PREFIX: &str = "bytes=";
/// `Content-Encoding` token for Brotli precompressed sidecars.
pub const ENCODING_BR: &str = "br";
/// `Content-Encoding` token for Gzip precompressed sidecars.
pub const ENCODING_GZIP: &str = "gzip";
/// File extension suffix for Brotli sidecar assets.
pub const SIDECAR_BR_EXT: &str = ".br";
/// File extension suffix for Gzip sidecar assets.
pub const SIDECAR_GZ_EXT: &str = ".gz";
/// `Vary` token emitted when serving negotiated precompressed sidecars.
pub const VARY_ACCEPT_ENCODING: &str = "Accept-Encoding";
/// Lowercase hexadecimal alphabet used for stack-allocated strong ETag formatting.
pub const HEX_DIGITS: & = b"0123456789abcdef";
/// Bitmask flag indicating client accepts Brotli content encoding.
pub const ENCODING_MASK_BR: u8 = 0b01;
/// Bitmask flag indicating client accepts Gzip content encoding.
pub const ENCODING_MASK_GZIP: u8 = 0b10;
/// Prefix for RFC 9110 `Content-Range` satisfied partial responses.
pub const CONTENT_RANGE_BYTES_PREFIX: &str = "bytes ";
/// Prefix for RFC 9110 `Content-Range` unsatisfiable (`416`) responses.
pub const CONTENT_RANGE_UNSAT_PREFIX: &str = "bytes */";
/// Stack buffer capacity in bytes for formatting `Content-Range` headers without heap allocation.
pub const CONTENT_RANGE_STACK_CAP: usize = 64;
/// Stack buffer capacity in bytes for lowercasing file extensions during MIME lookup.
pub const MIME_EXT_STACK_CAP: usize = 24;
/// Stack buffer capacity in bytes for formatting file ETags (`"<hex>-<hex>"`).
pub const ETAG_STACK_CAP: usize = 40;
/// Weak ETag prefix stripped during weak comparison.
pub const WEAK_ETAG_PREFIX: &str = "W/";
/// Wildcard `If-None-Match` token.
pub const ETAG_WILDCARD: &str = "*";
/// Multiplicative 64-bit mixing constant for zero-allocation [`FxHasher`].
pub const FX_HASH_K: u64 = 0x517c_c1b7_2722_0a95;
/// 256-entry ASCII hex nibble decode table (`0..=15` valid, `0xFF` invalid).
pub const HEX_DECODE_LUT: = ;
/// Two-digit ASCII decimal lookup pairs for `00..=99`.
pub const DEC_DIGITS_LUT: & = b"00010203040506070809\
10111213141516171819\
20212223242526272829\
30313233343536373839\
40414243444546474849\
50515253545556575859\
60616263646566676869\
70717273747576777879\
80818283848586878889\
90919293949596979899";
/// ASCII forward slash byte.
pub const BYTE_SLASH: u8 = b'/';
/// ASCII backslash byte.
pub const BYTE_BACKSLASH: u8 = b'\\';
/// ASCII percent byte.
pub const BYTE_PERCENT: u8 = b'%';
/// ASCII dot byte.
pub const BYTE_DOT: u8 = b'.';
/// ASCII double quote byte.
pub const BYTE_QUOTE: u8 = b'"';
/// ASCII hyphen byte.
pub const BYTE_DASH: u8 = b'-';
/// ASCII comma byte.
pub const BYTE_COMMA: u8 = b',';
/// ASCII semicolon byte.
pub const BYTE_SEMICOLON: u8 = b';';
/// ASCII zero digit byte.
pub const BYTE_ZERO: u8 = b'0';
/// Lowercase fast-path extension byte array for `js`.
pub const EXT_JS: = *b"js";
/// Lowercase fast-path extension byte array for `css`.
pub const EXT_CSS: = *b"css";
/// Lowercase fast-path extension byte array for `png`.
pub const EXT_PNG: = *b"png";
/// Lowercase fast-path extension byte array for `jpg`.
pub const EXT_JPG: = *b"jpg";
/// Lowercase fast-path extension byte array for `svg`.
pub const EXT_SVG: = *b"svg";
/// Lowercase fast-path extension byte array for `gif`.
pub const EXT_GIF: = *b"gif";
/// Lowercase fast-path extension byte array for `ico`.
pub const EXT_ICO: = *b"ico";
/// Lowercase fast-path extension byte array for `htm`.
pub const EXT_HTM: = *b"htm";
/// Lowercase fast-path extension byte array for `txt`.
pub const EXT_TXT: = *b"txt";
/// Lowercase fast-path extension byte array for `xml`.
pub const EXT_XML: = *b"xml";
/// Lowercase fast-path extension byte array for `pdf`.
pub const EXT_PDF: = *b"pdf";
/// Lowercase fast-path extension byte array for `ttf`.
pub const EXT_TTF: = *b"ttf";
/// Lowercase fast-path extension byte array for `otf`.
pub const EXT_OTF: = *b"otf";
/// Lowercase fast-path extension byte array for `mp4`.
pub const EXT_MP4: = *b"mp4";
/// Lowercase fast-path extension byte array for `mp3`.
pub const EXT_MP3: = *b"mp3";
/// Lowercase fast-path extension byte array for `html`.
pub const EXT_HTML: = *b"html";
/// Lowercase fast-path extension byte array for `json`.
pub const EXT_JSON: = *b"json";
/// Lowercase fast-path extension byte array for `wasm`.
pub const EXT_WASM: = *b"wasm";
/// Lowercase fast-path extension byte array for `webp`.
pub const EXT_WEBP: = *b"webp";
/// Lowercase fast-path extension byte array for `jpeg`.
pub const EXT_JPEG: = *b"jpeg";
/// Lowercase fast-path extension byte array for `woff`.
pub const EXT_WOFF: = *b"woff";
/// Lowercase fast-path extension byte array for `webm`.
pub const EXT_WEBM: = *b"webm";
/// Lowercase fast-path extension byte array for `woff2`.
pub const EXT_WOFF2: = *b"woff2";
/// Quality-factor parameter prefix lowercase (`"q="`).
pub const QUALITY_PREFIX_LOWER: &str = "q=";
/// Quality-factor parameter prefix uppercase (`"Q="`).
pub const QUALITY_PREFIX_UPPER: &str = "Q=";