pub struct Request {
pub verb: Method,
pub protocol: Protocol,
pub path: EcoString,
pub body: Bytes,
pub headers: Arc<HeaderMap>,
pub query: HashMap<String, String>,
}Expand description
Inbound request block: verb, protocol, path, body, headers, and parsed query.
path and headers are stored as Arc so that Context::clone() —
which fires in WebSocket dispatch — is a refcount bump rather than a deep
copy. The initial allocation per request is identical; the gain is on the
clone path (WS upgrade, auth middleware that clones context, etc.).
Fields§
§verb: MethodHTTP method (or the protocol-equivalent verb for non-HTTP transports).
protocol: ProtocolWire protocol the request arrived on (REST / WebSocket / MQTT / …).
path: EcoStringRequest path, app-prefix included (e.g. /yeti-auth/Users/alice).
EcoString: inline (zero heap) for paths ≤ 15 bytes, Arc-backed clone
for longer paths. Either way Context::clone() is O(1).
body: BytesRaw request body bytes (refcounted; cheap to clone).
headers: Arc<HeaderMap>Inbound request headers.
Arc so Context::clone() is a refcount bump, not a full HeaderMap copy.
query: HashMap<String, String>Parsed query string, plus synthetic keys routing injects downstream.