Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§