Trait unc_jsonrpc_client::methods::RpcHandlerError

source ·
pub trait RpcHandlerError: DeserializeOwned {
    // Provided methods
    fn parse(handler_error: Value) -> Result<Self, Error> { ... }
    fn parse_legacy_error(_error: Value) -> Option<Result<Self, Error>> { ... }
}
Expand description

A trait identifying valid unc JSON-RPC errors.

Provided Methods§

source

fn parse(handler_error: Value) -> Result<Self, Error>

Parser for the .error_struct field in RpcError.

source

fn parse_legacy_error(_error: Value) -> Option<Result<Self, Error>>

Parser for the .data field in RpcError, not .error_struct.

This would only ever be used as a fallback if RpcHandlerError::parse fails.

Defaults to None meaning there’s no alternative deserialization available.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl RpcHandlerError for Value

source§

fn parse(handler_error: Value) -> Result<Self, Error>

Implementors§