An HTTP web framework and server for Rust supporting HTTP/1.1, HTTP/2, and HTTP/3. No third-party HTTP dependencies — parsing, routing, middleware, auth, WebSocket, SSE, caching, tracing, and MCP server are all built in.
usestd::collections::HashMap;usecrate::symbol::SYMBOL;usecrate::url::URL;/// Parser and serialiser for `application/x-www-form-urlencoded` bodies.
pubstructFormUrlEncoded;implFormUrlEncoded{/// Parses a URL-encoded body into a `HashMap` of field name → value.
pubfnparse(data:Vec<u8>)->Result<HashMap<String, String>, String>{let boxed_string =String::from_utf8(data);if boxed_string.is_err(){let message = boxed_string.err().unwrap().to_string();returnErr(message)}let string = boxed_string.unwrap();let string = string.replace(|x:char|x.is_ascii_control(),SYMBOL.empty_string).trim().to_string();Ok(URL::parse_query(&string))}pubfngenerate(map:HashMap<String, String>)-> String{URL::build_query(map)}}