pub fn json_to_type_or_error<T: DeserializeOwned>(
    response: serde_json::Value,
) -> Result<ResponseOrError<T>> {
    Ok(serde_json::from_value(response)
        .map_err(|x| {
            ProtocolError::coerce_static_from_str(&format!("{:#?}", x))
        })?)
}
/// Helper to convert JSON to a response or error
Helper to convert JSON to a response or error
Helper to convert JSON to a response or error
pub fn json_to_type_or_error<T: DeserializeOwned>(
    response: serde_json::Value,
) -> Result<ResponseOrError<T>> {
    Ok(serde_json::from_value(response)
        .map_err(|x| {
            ProtocolError::coerce_static_from_str(&format!("{:#?}", x))
        })?)
}
pub fn json_to_type_or_error < T : DeserializeOwned > ( response : serde_json :: Value , ) -> Result < ResponseOrError < T > > { Ok ( serde_json :: from_value ( response ) . map_err ( | x | { ProtocolError :: coerce_static_from_str ( & format ! ( " " x ) ) } ) ? ) }
Helper to convert JSON to a response or error
Helper to convert JSON to a response or error
response
serde_json::Value