Trait llmvm_protocol::stdio::RequestJsonRpcConvert
source · 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§
sourcefn from_jsonrpc_request(
value: JsonRpcRequest
) -> Result<Option<Request>, ProtocolError>
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.
sourcefn into_jsonrpc_request(&self) -> JsonRpcRequest
fn into_jsonrpc_request(&self) -> JsonRpcRequest
Serializes a Request
into a JsonRpcRequest
.
Object Safety§
This trait is not object safe.