pub trait RequestJsonRpcConvert<Request> {
    // Required methods
    fn from_jsonrpc_request(
        value: JsonRpcRequest
    ) -> Result<Option<Request>, ProtocolError>;
    fn into_jsonrpc_request(&self) -> JsonRpcRequest;
}
Expand description

A request that can convert to and from a JsonRpcRequest.

Required Methods§

source

fn from_jsonrpc_request( value: JsonRpcRequest ) -> Result<Option<Request>, ProtocolError>

Deserializes a JsonRpcRequest into Request. Returns a protocol error if the request conversion fails (i.e. request validation fails, unexpected error, etc.). Returns None if the request type is unknown or unsupported, which is synonymous with a “not found” error.

source

fn into_jsonrpc_request(&self) -> JsonRpcRequest

Serializes a Request into a JsonRpcRequest.

Object Safety§

This trait is not object safe.

Implementors§