Skip to main content

Crate rws_base

Crate rws_base 

Source
Expand description

The lowest layer of rust-web-server: string symbols, small helpers, base64 / SHA-256 / X.509 helpers, MIME types, URL parsing, HTTP versions and dates, and DNS wire format.

Internal to rust-web-server, released with it at the same version: use these through the rust_web_server paths (rust_web_server::core, rust_web_server::mime_type, …), which stay stable; this crate’s own layout may change in any release. See spec/WORKSPACE_SPLIT.md.

Modules§

core
Small shared utilities: base64, sha256 (SHA-256, HMAC-SHA256) and the New trait (a constructor used across the crate, much like Default).
ext
http
mime_type
null
Null: a value representing JSON null, with FromStr (failing with ParseNullError), Display, Clone, Debug, PartialEq and New.
symbol
url
URL helpers: percent encoding (URL::percent_encode / percent_decode), query strings (URL::build_query / parse_query) and whole URLs (URL::build / parse, a panic-free RFC 3986 parser). URL::parse_request_target gives a request’s path and query without inventing a scheme and host. Percent encoding is what lets a query value carry a space (%20), = (%3D) or & (%26). Examples: crates/rws-base/src/url/example/.