Advertisement
Guest User

Untitled

a guest
Sep 6th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.38 KB | None | 0 0
  1. async fn handle_request(
  2.     req: Request<Body>,
  3.     table: Arc<Table<Invitation>>,
  4. ) -> Result<Response<Body>> {
  5.     let path_segments: Vec<&str> = req.uri().path().trim_matches('/').split('/').collect();
  6.  
  7.     match (req.method(), path_segments.as_slice()) {
  8.         (&Method::GET, ["invitations", id]) => api_get_response(table, id).await,
  9.         _ => not_found(),
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement