Struct hyper_router::Route
[−]
[src]
pub struct Route { pub method: Method, pub path: Path, pub handler: Handler, }
Holds route information
Fields
method: Method
HTTP method to match
path: Path
Path to match
handler: Handler
Request handler
This should be method that accepts Hyper's Request and Response:
use hyper::server::{Request, Response}; fn hello_handler(_: Request, res: Response) { res.send(b"Hello World").unwrap(); }