pub trait HttpRequestView: Send + Sync {
// Required methods
fn method(&self) -> &Method;
fn uri(&self) -> &Uri;
fn headers(&self) -> &HeaderMap;
fn cookie(&self, name: &str) -> Option<&str>;
fn path_parameter(&self, name: &str) -> Option<&str>;
fn query_parameters(&self, name: &str) -> Option<&[String]>;
fn client_ip(&self) -> Option<IpAddr>;
fn request_id(&self) -> Option<&MessageId>;
}Expand description
Read-only request view implemented by framework adapters or HttpRequestParts.
Request bodies are intentionally absent. Framework extractors and validation adapters own body buffering, decoding, and typed input construction.
Required Methods§
Returns one parsed cookie value.
Sourcefn path_parameter(&self, name: &str) -> Option<&str>
fn path_parameter(&self, name: &str) -> Option<&str>
Returns one decoded route parameter.
Sourcefn query_parameters(&self, name: &str) -> Option<&[String]>
fn query_parameters(&self, name: &str) -> Option<&[String]>
Returns every decoded value for one query parameter.
Sourcefn client_ip(&self) -> Option<IpAddr>
fn client_ip(&self) -> Option<IpAddr>
Returns the normalized client IP when trusted proxy processing supplied it.
Sourcefn request_id(&self) -> Option<&MessageId>
fn request_id(&self) -> Option<&MessageId>
Returns the request identity generated or accepted by the application boundary.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".