Type Definition peta::ResponseFut

source ·
pub type ResponseFut = Box<dyn Future<Item = Response, Error = ()> + Send + Sync>;
Expand description

Abstraction of the return Boxed Future.

Example

Each function which will be passed to Router must return ResponseFut

fn hello(req: Request) -> ResponseFut {
  // rest of the code
}

router.get("/", hello)