jsonrpc_core_client::transports

Function parse_response

Source
pub fn parse_response(
    response: &str,
) -> Result<(Id, Result<Value, RpcError>, Option<String>, Option<SubscriptionId>), RpcError>
Expand description

Parse raw string into a single JSON value, together with the request Id.

This method will attempt to parse a JSON-RPC response object (either Failure or Success) and a Notification (for Subscriptions). Note that if you have more specific expectations about the returned type and don’t want to handle all of them it might be best to deserialize on your own.