pub trait RequestLike {
    // Required methods
    fn uri(&self) -> Uri;
    fn is_same_uri(&self, other: &Uri) -> bool;
    fn method(&self) -> &Method;
    fn headers(&self) -> &HeaderMap;
}
Expand description

Allows using either Request or request::Parts, or your own newtype.

Required Methods§

source

fn uri(&self) -> Uri

Same as req.uri().clone()

source

fn is_same_uri(&self, other: &Uri) -> bool

Whether the effective request URI matches the other URI

It can be naive string comparison, nothing fancy

source

fn method(&self) -> &Method

Same as req.method()

source

fn headers(&self) -> &HeaderMap

Same as req.headers()

Implementations on Foreign Types§

source§

impl RequestLike for Parts

source§

fn uri(&self) -> Uri

source§

fn is_same_uri(&self, other: &Uri) -> bool

source§

fn method(&self) -> &Method

source§

fn headers(&self) -> &HeaderMap

source§

impl<Body> RequestLike for Request<Body>

source§

fn uri(&self) -> Uri

source§

fn is_same_uri(&self, other: &Uri) -> bool

source§

fn method(&self) -> &Method

source§

fn headers(&self) -> &HeaderMap

Implementors§