pub async fn from_response(res: Response<Body>) -> Result<Self, ClientParseError> {
        if res.headers().get(header::CONTENT_TYPE).is_some() {
            if res.headers().get(header::CONTENT_TYPE).unwrap() != CBOR_MIME {
                return Err(ClientParseError::InvalidHeader);
            }
        } else {
            return Err(ClientParseError::InvalidHeader);
        }

        let body = hyper::body::aggregate(res)
            .await
            .map_err(|_| ClientParseError::InvalidBody)?;
        let msg = from_reader(body.reader()).map_err(|_| ClientParseError::InvalidCbor)?;

        Ok(msg)
    }
/// Tries to parse an [`IpcMessage`] from the provided HTTP response
Tries to parse an [`IpcMessage`] from the provided HTTP response
Tries to parse an [ ` IpcMessage ` ] from the provided HTTP response
pub async fn from_response(res: Response<Body>) -> Result<Self, ClientParseError> {
        if res.headers().get(header::CONTENT_TYPE).is_some() {
            if res.headers().get(header::CONTENT_TYPE).unwrap() != CBOR_MIME {
                return Err(ClientParseError::InvalidHeader);
            }
        } else {
            return Err(ClientParseError::InvalidHeader);
        }
        let body = hyper::body::aggregate(res)
            .await
            .map_err(|_| ClientParseError::InvalidBody)?;
        let msg = from_reader(body.reader()).map_err(|_| ClientParseError::InvalidCbor)?;
        Ok(msg)
    }
pub async fn from_response ( res : Response < Body > ) -> Result < Self , ClientParseError > { if res . headers ( ) . get ( header :: CONTENT_TYPE ) . is_some ( ) { if res . headers ( ) . get ( header :: CONTENT_TYPE ) . unwrap ( ) != CBOR_MIME { return Err ( ClientParseError :: InvalidHeader ) ; } } else { return Err ( ClientParseError :: InvalidHeader ) ; } let body = hyper :: body :: aggregate ( res ) . await . map_err ( | _ | ClientParseError :: InvalidBody ) ? ; let msg = from_reader ( body . reader ( ) ) . map_err ( | _ | ClientParseError :: InvalidCbor ) ? ; Ok ( msg ) }
Tries to parse an [`IpcMessage`] from the provided HTTP response
Tries to parse an [ ` IpcMessage ` ] from the provided HTTP response
res
Response<Body>