Trait HttpRequestParts

pub trait HttpRequestParts {
    // Required methods
    fn method(&self) -> &Method;
    fn uri(&self) -> &Uri;
    fn version(&self) -> Version;
    fn headers(&self) -> &HeaderMap;
    fn extensions(&self) -> &Extensions;
}
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

fn extensions(&self) -> &Extensions

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

§

fn extensions(&self) -> &Extensions

§

impl<T> HttpRequestParts for &mut T

§

fn method(&self) -> &Method

§

fn uri(&self) -> &Uri

§

fn version(&self) -> Version

§

fn headers(&self) -> &HeaderMap

§

fn extensions(&self) -> &Extensions

Implementors§

§

impl HttpRequestParts for Parts

§

impl<Body> HttpRequestParts for Request<Body>