/// Write the "self describing" CBOR tag and serialize the response
Write the "self describing" CBOR tag and serialize the response
Write the " self describing " CBOR tag and serialize the response
pub(crate) fn cbor_response<R: Serialize>(r: &R) -> Response<Body> {
    use hyper::header;
    let mut response = Response::new(Body::from(into_cbor(r)));
    *response.status_mut() = StatusCode::OK;
    *response.headers_mut() = get_cors_headers();
    response.headers_mut().insert(
        header::CONTENT_TYPE,
        header::HeaderValue::from_static(CONTENT_TYPE_CBOR),
    );
    response
}
pub ( crate ) fn cbor_response < R : Serialize > ( r : & R ) -> Response < Body > { use hyper :: header ; let mut response = Response :: new ( Body :: from ( into_cbor ( r ) ) ) ; * response . status_mut ( ) = StatusCode :: OK ; * response . headers_mut ( ) = get_cors_headers ( ) ; response . headers_mut ( ) . insert ( header :: CONTENT_TYPE , header :: HeaderValue :: from_static ( CONTENT_TYPE_CBOR ) , ) ; response }
Write the "self describing" CBOR tag and serialize the response
Write the " self describing " CBOR tag and serialize the response
r
&R