/// Routes `req` to the appropriate handler, if any, returning the handler
/// response.
Routes `req` to the appropriate handler, if any, returning the handler
response.
Routes ` req ` to the appropriate handler if any returning the handler response .
pub async fn route(&self, req: Request<Body>) -> Result<Response<Body>, Error> {
        match (req.method(), req.uri().path()) {
            (&Method::POST, "/api/v2/write") => self.write_handler(req).await,
            (&Method::POST, "/api/v2/delete") => self.delete_handler(req).await,
            _ => return Err(Error::NoHandler),
        }
        .map(|_| response_no_content())
    }
pub async fn route ( & self , req : Request < Body > ) -> Result < Response < Body > , Error > { match ( req . method ( ) , req . uri ( ) . path ( ) ) { ( & Method :: POST , " " ) => self . write_handler ( req ) . await , ( & Method :: POST , " " ) => self . delete_handler ( req ) . await , _ => return Err ( Error :: NoHandler ) , } . map ( | _ | response_no_content ( ) ) }
Routes `req` to the appropriate handler, if any, returning the handler
response.
Routes ` req ` to the appropriate handler if any returning the handler response .
&self
req
Request<Body>