Trait Request

Source
pub trait Request {
    type Method: Eq + Hash + Clone + Send + Sync;

    // Required methods
    fn path<'a>(&'a self) -> &'a str;
    fn method<'a>(&'a self) -> &Self::Method;
}
Expand description

Trait to represent a Request which can be handled

Required Associated Types§

Source

type Method: Eq + Hash + Clone + Send + Sync

Request method, as in HTTP

Required Methods§

Source

fn path<'a>(&'a self) -> &'a str

Path of request. Should not have a leading slash.

Source

fn method<'a>(&'a self) -> &Self::Method

Request method, as in HTTP

Implementations on Foreign Types§

Source§

impl Request for String

Source§

type Method = ()

Source§

fn path(&self) -> &str

Source§

fn method(&self) -> &Self::Method

Source§

impl<B> Request for Request<B>

Source§

type Method = Method

Source§

fn path(&self) -> &str

Source§

fn method(&self) -> &Self::Method

Implementors§