Route

Type Alias Route 

Source
pub type Route = Route<Method, Handler>;
Expand description

A single route, tied to Hyper’s types, and our Handler. We add some shortcut methods onto this type in order to make building routes for hyper easier.

Aliased Type§

pub struct Route { /* private fields */ }

Implementations§

Source§

impl Route

Source

pub fn options<P, F>(path: P, handler: F) -> Self
where P: Into<Cow<'static, str>>, F: Fn(Request<Body>, Vec<String>) -> Box<dyn Future<Item = Response<Body>, Error = Error> + Send + 'static> + Send + 'static,

Source

pub fn get<P, F>(path: P, handler: F) -> Self
where P: Into<Cow<'static, str>>, F: Fn(Request<Body>, Vec<String>) -> Box<dyn Future<Item = Response<Body>, Error = Error> + Send + 'static> + Send + 'static,

Source

pub fn post<P, F>(path: P, handler: F) -> Self
where P: Into<Cow<'static, str>>, F: Fn(Request<Body>, Vec<String>) -> Box<dyn Future<Item = Response<Body>, Error = Error> + Send + 'static> + Send + 'static,

Source

pub fn put<P, F>(path: P, handler: F) -> Self
where P: Into<Cow<'static, str>>, F: Fn(Request<Body>, Vec<String>) -> Box<dyn Future<Item = Response<Body>, Error = Error> + Send + 'static> + Send + 'static,

Source

pub fn delete<P, F>(path: P, handler: F) -> Self
where P: Into<Cow<'static, str>>, F: Fn(Request<Body>, Vec<String>) -> Box<dyn Future<Item = Response<Body>, Error = Error> + Send + 'static> + Send + 'static,

Source

pub fn head<P, F>(path: P, handler: F) -> Self
where P: Into<Cow<'static, str>>, F: Fn(Request<Body>, Vec<String>) -> Box<dyn Future<Item = Response<Body>, Error = Error> + Send + 'static> + Send + 'static,

Source

pub fn trace<P, F>(path: P, handler: F) -> Self
where P: Into<Cow<'static, str>>, F: Fn(Request<Body>, Vec<String>) -> Box<dyn Future<Item = Response<Body>, Error = Error> + Send + 'static> + Send + 'static,

Source

pub fn connect<P, F>(path: P, handler: F) -> Self
where P: Into<Cow<'static, str>>, F: Fn(Request<Body>, Vec<String>) -> Box<dyn Future<Item = Response<Body>, Error = Error> + Send + 'static> + Send + 'static,

Source

pub fn patch<P, F>(path: P, handler: F) -> Self
where P: Into<Cow<'static, str>>, F: Fn(Request<Body>, Vec<String>) -> Box<dyn Future<Item = Response<Body>, Error = Error> + Send + 'static> + Send + 'static,