Skip to main content

HttpRequestParts

Trait HttpRequestParts 

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

Source

fn method(&self) -> &Method

Source

fn uri(&self) -> &Uri

Source

fn version(&self) -> Version

Source

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§

Source§

impl<T> HttpRequestParts for &T

Source§

fn method(&self) -> &Method

Source§

fn uri(&self) -> &Uri

Source§

fn version(&self) -> Version

Source§

fn headers(&self) -> &HeaderMap

Source§

impl<T> HttpRequestParts for &mut T

Source§

fn method(&self) -> &Method

Source§

fn uri(&self) -> &Uri

Source§

fn version(&self) -> Version

Source§

fn headers(&self) -> &HeaderMap

Implementors§