async fn handle(&self, req: Request<hyper::Body>) -> Result<Response<hyper::Body>> {
        match self.process_request(req).await {
            Ok(resp) => Ok(resp),
            Err(e) => {
                println!("Error while processing request: {}", e);
                Ok(
                    Response::builder()
                        .status(hyper::StatusCode::INTERNAL_SERVER_ERROR)
                        .body(hyper::Body::from("error"))
                        .unwrap(), // error handling error
                )
            }
        }
    }
/// This function returns a HTTP response depending on the result of `process_request`.
This function returns a HTTP response depending on the result of `process_request`.
This function returns a HTTP response depending on the result of ` process_request ` .
async fn handle(&self, req: Request<hyper::Body>) -> Result<Response<hyper::Body>> {
        match self.process_request(req).await {
            Ok(resp) => Ok(resp),
            Err(e) => {
                println!("Error while processing request: {}", e);
                Ok(
                    Response::builder()
                        .status(hyper::StatusCode::INTERNAL_SERVER_ERROR)
                        .body(hyper::Body::from("error"))
                        .unwrap(), // error handling error
                )
            }
        }
    }
async fn handle ( & self , req : Request < hyper :: Body > ) -> Result < Response < hyper :: Body > > { match self . process_request ( req ) . await { Ok ( resp ) => Ok ( resp ) , Err ( e ) => { println ! ( " " e ) ; Ok ( Response :: builder ( ) . status ( hyper :: StatusCode :: INTERNAL_SERVER_ERROR ) . body ( hyper :: Body :: from ( " " ) ) . unwrap ( ) , // error handling error ) } } }
This function returns a HTTP response depending on the result of `process_request`.
This function returns a HTTP response depending on the result of ` process_request ` .
&self
req
Request<hyper::Body>