pub trait HttpRequestParts {
// Required methods
fn value(
&self,
source: InputSource,
name: &str,
index: usize,
) -> Option<Cow<'_, str>>;
fn body(&self) -> &[u8] ⓘ;
// Provided methods
fn take_body_stream(&self) -> Option<StreamingBody> { ... }
fn extension(&self, _type_id: TypeId) -> Option<&dyn Any> { ... }
fn method(&self) -> Option<HttpMethod> { ... }
fn path(&self) -> Option<&str> { ... }
fn peer_addr(&self) -> Option<SocketAddr> { ... }
fn scheme(&self) -> Option<&str> { ... }
fn host(&self) -> Option<&str> { ... }
}Expand description
Borrowed HTTP request values used by the compiled executor.
Production adapters implement this view over their native request without copying headers, query strings, or request bodies.
Required Methods§
fn value( &self, source: InputSource, name: &str, index: usize, ) -> Option<Cow<'_, str>>
fn body(&self) -> &[u8] ⓘ
Provided Methods§
Sourcefn take_body_stream(&self) -> Option<StreamingBody>
fn take_body_stream(&self) -> Option<StreamingBody>
Transfers an adapter-owned pull request body to a streaming extractor.
Sourcefn extension(&self, _type_id: TypeId) -> Option<&dyn Any>
fn extension(&self, _type_id: TypeId) -> Option<&dyn Any>
Returns transport context installed by HTTP middleware.
The default keeps non-HTTP transports and existing adapters allocation free. HTTP adapters only allocate extension storage when middleware actually installs a value.
Sourcefn method(&self) -> Option<HttpMethod>
fn method(&self) -> Option<HttpMethod>
The request method, when the adapter exposes raw request parts.
Every accessor in this family defaults to None so existing adapters
keep compiling; the first-party HTTP adapter forwards each one borrowed
from its receive buffer.
Sourcefn peer_addr(&self) -> Option<SocketAddr>
fn peer_addr(&self) -> Option<SocketAddr>
Address of the direct network peer, when known by the adapter.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".