pub fn json_response(obj: &serde_json::Value) -> Response {
    let body = serde_json::to_string_pretty(&obj).expect("unable to coerce JSON Value into string");
    let mut res = Response::new(Body::from(body));
    res.typed_header(ContentType::json());
    res
}
/// Helper function for returning a response with JSON data.
///
/// Serializes the argument value to JSON and returns a HTTP 200 response
/// code with the serialized JSON as the body.
Helper function for returning a response with JSON data.
Serializes the argument value to JSON and returns a HTTP 200 response
code with the serialized JSON as the body.
Helper function for returning a response with JSON data . Serializes the argument value to JSON and returns a HTTP 200 response code with the serialized JSON as the body .
pub fn json_response(obj: &serde_json::Value) -> Response {
    let body = serde_json::to_string_pretty(&obj).expect("unable to coerce JSON Value into string");
    let mut res = Response::new(Body::from(body));
    res.typed_header(ContentType::json());
    res
}
pub fn json_response ( obj : & serde_json :: Value ) -> Response { let body = serde_json :: to_string_pretty ( & obj ) . expect ( " " ) ; let mut res = Response :: new ( Body :: from ( body ) ) ; res . typed_header ( ContentType :: json ( ) ) ; res }
Helper function for returning a response with JSON data.
Helper function for returning a response with JSON data .
obj
&serde_json::Value
obj
&serde_json::Value