pub struct RequestData {
pub path_params: Arc<HashMap<String, String>>,
pub query_params: Value,
pub validated_params: Option<Value>,
pub raw_query_params: Arc<HashMap<String, Vec<String>>>,
pub body: Value,
pub raw_body: Option<Vec<u8>>,
pub headers: Arc<HashMap<String, String>>,
pub cookies: Arc<HashMap<String, String>>,
pub method: String,
pub path: String,
}Expand description
Request data extracted from HTTP request
This is the language-agnostic representation passed to handlers.
Uses Arc for HashMaps to enable cheap cloning without duplicating data.
When RequestData is cloned, only the Arc pointers are cloned, not the underlying data.
Performance optimization: raw_body stores the unparsed request body bytes.
Language bindings should use raw_body when possible to avoid double-parsing.
The body field is lazily parsed only when needed for validation.
Fields§
§path_params: Arc<HashMap<String, String>>Path parameters extracted from the URL path
query_params: ValueQuery parameters parsed as JSON
validated_params: Option<Value>Validated parameters produced by ParameterValidator (query/path/header/cookie combined).
raw_query_params: Arc<HashMap<String, Vec<String>>>Raw query parameters as key-value pairs
body: ValueParsed request body as JSON
raw_body: Option<Vec<u8>>§headers: Arc<HashMap<String, String>>Request headers
Request cookies
method: StringHTTP method (GET, POST, etc.)
path: StringRequest path
Trait Implementations§
Source§impl Clone for RequestData
impl Clone for RequestData
Source§fn clone(&self) -> RequestData
fn clone(&self) -> RequestData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more