Skip to main content

HttpRequestParts

Trait HttpRequestParts 

pub trait HttpRequestParts: ExtensionsRef {
    // Required methods
    fn method(&self) -> &Method;
    fn uri(&self) -> &Uri;
    fn version(&self) -> Version;
    fn headers(&self) -> &HeaderMap;
}
Available on crate feature http only.
Expand description

HttpRequestParts is used in places where we don’t need the ReqBody of the HttpRequest

In those places we need to support using HttpRequest and Parts. By using this trait we can support both types behind a single generic that implements this trait.

Required Methods§

fn method(&self) -> &Method

fn uri(&self) -> &Uri

fn version(&self) -> Version

fn headers(&self) -> &HeaderMap

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl<T> HttpRequestParts for &T

§

fn method(&self) -> &Method

§

fn uri(&self) -> &Uri

§

fn version(&self) -> Version

§

fn headers(&self) -> &HeaderMap

§

impl<T> HttpRequestParts for &mut T

§

fn method(&self) -> &Method

§

fn uri(&self) -> &Uri

§

fn version(&self) -> Version

§

fn headers(&self) -> &HeaderMap

Implementors§

§

impl HttpRequestParts for Parts

§

impl<Body> HttpRequestParts for Request<Body>