pub(crate) fn json_response<R: Serialize>(r: &R) -> (Response<Body>, usize) {
    let buf = serde_json::to_vec(r).expect("Could not serialize response");
    let size_bytes = buf.len();

    let response = Response::builder()
        .header("Content-Type", "application/json")
        .body(buf.into())
        .unwrap();

    (response, size_bytes)
}
/// Serializes the response as JSON.
Serializes the response as JSON.
Serializes the response as JSON .
pub(crate) fn json_response<R: Serialize>(r: &R) -> (Response<Body>, usize) {
    let buf = serde_json::to_vec(r).expect("Could not serialize response");
    let size_bytes = buf.len();
    let response = Response::builder()
        .header("Content-Type", "application/json")
        .body(buf.into())
        .unwrap();
    (response, size_bytes)
}
pub ( crate ) fn json_response < R : Serialize > ( r : & R ) -> ( Response < Body > , usize ) { let buf = serde_json :: to_vec ( r ) . expect ( " " ) ; let size_bytes = buf . len ( ) ; let response = Response :: builder ( ) . header ( " " , " " ) . body ( buf . into ( ) ) . unwrap ( ) ; ( response , size_bytes ) }
Serializes the response as JSON.
Serializes the response as JSON .
r
&R
r
&R