Struct luminal_router::Router
[−]
[src]
pub struct Router { /* fields omitted */ }
Router for Hyper.
Methods
impl Router
[src]
pub fn new() -> Self
[src]
pub fn add<S: Service<Request = Request, Response = Response, Error = Error, Future = LuminalFuture> + 'static>(
&mut self,
method: Method,
route: &str,
service: S
) -> Result<(), Error>
[src]
&mut self,
method: Method,
route: &str,
service: S
) -> Result<(), Error>
Add a handler at the specific route path for the given Method
.
pub fn dispatch<'a>(
&'a self,
method: &Method,
route_path: &str
) -> Option<&'a Option<Route<Box<Service<Request = Request, Response = Response, Error = Error, Future = LuminalFuture>>>>>
[src]
&'a self,
method: &Method,
route_path: &str
) -> Option<&'a Option<Route<Box<Service<Request = Request, Response = Response, Error = Error, Future = LuminalFuture>>>>>
Trait Implementations
impl Default for Router
[src]
impl Service for Router
[src]
type Request = Request
Requests handled by the service.
type Response = Response
Responses given by the service.
type Error = Error
Errors produced by the service.
type Future = LuminalFuture
The future response value.
fn call(&self, req: Request) -> Self::Future
[src]
Process the request and return the response asynchronously.