pub trait HttpRequestView {
// Required methods
fn method(&self) -> HttpMethod;
fn target(&self) -> &str;
fn header_value(&self, name: &str, index: usize) -> Option<&str>;
fn body(&self) -> &[u8] ⓘ;
// Provided methods
fn take_body_stream(&self) -> Option<StreamingBody> { ... }
fn peer_addr(&self) -> Option<SocketAddr> { ... }
fn scheme(&self) -> &str { ... }
}Expand description
Borrowed request access used by in-memory and native HTTP adapters.
Adapters can implement this trait directly over their receive buffer so dispatch does not require copying the target, headers, or body.
Required Methods§
fn method(&self) -> HttpMethod
fn target(&self) -> &str
fn header_value(&self, name: &str, index: usize) -> Option<&str>
fn body(&self) -> &[u8] ⓘ
Provided Methods§
Sourcefn take_body_stream(&self) -> Option<StreamingBody>
fn take_body_stream(&self) -> Option<StreamingBody>
Transfers a pull-based request body to the operation, when supported.
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".