Trait hyper_router::RoutesBuilder
[−]
[src]
pub trait RoutesBuilder: Sized {
type Recognizer: RouteRecognizer;
fn route<S, H>(self, method: Method, pattern: S, handler: H) -> Self
where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>;
fn finish(self) -> Self::Recognizer;
fn get<S, H>(self, pattern: S, handler: H) -> Self
where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
{ ... }
fn post<S, H>(self, pattern: S, handler: H) -> Self
where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
{ ... }
fn put<S, H>(self, pattern: S, handler: H) -> Self
where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
{ ... }
fn delete<S, H>(self, pattern: S, handler: H) -> Self
where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
{ ... }
fn head<S, H>(self, pattern: S, handler: H) -> Self
where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
{ ... }
fn options<S, H>(self, pattern: S, handler: H) -> Self
where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
{ ... }
}
Associated Types
type Recognizer: RouteRecognizer
Required Methods
fn route<S, H>(self, method: Method, pattern: S, handler: H) -> Self where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
Add a new route with given glob pattern.
fn finish(self) -> Self::Recognizer
Create recoginizer
Provided Methods
fn get<S, H>(self, pattern: S, handler: H) -> Self where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
Add handler for 'GET' method
fn post<S, H>(self, pattern: S, handler: H) -> Self where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
Add handler for 'POST' method
fn put<S, H>(self, pattern: S, handler: H) -> Self where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
Add handler for 'PUT' method
fn delete<S, H>(self, pattern: S, handler: H) -> Self where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
Add handler for 'DELETE' method
fn head<S, H>(self, pattern: S, handler: H) -> Self where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
Add handler for 'HEAD' method
fn options<S, H>(self, pattern: S, handler: H) -> Self where
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
S: AsRef<str>,
H: RouteHandler<<Self::Recognizer as RouteRecognizer>::Captures>,
Add handler for 'OPTIONS' method
Implementors
impl RoutesBuilder for RegexRoutesBuilder