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 NEAR JSON-RPC errors.
Provided Methods§
Sourcefn parse(handler_error: Value) -> Result<Self, Error>
fn parse(handler_error: Value) -> Result<Self, Error>
Parser for the .error_struct field in RpcError.
Sourcefn parse_legacy_error(_error: Value) -> Option<Result<Self, Error>>
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.