pub enum JsonrpcMessage {
Request(JsonrpcRequest),
Notification(JsonrpcNotification),
BatchRequest(JsonrpcBatchRequest),
Response(JsonrpcResponse),
Error(JsonrpcError),
BatchResponse(JsonrpcBatchResponse),
}
Expand description
Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
JSON schema
{
"description": "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.",
"anyOf": [
{
"$ref": "#/definitions/JSONRPCRequest"
},
{
"$ref": "#/definitions/JSONRPCNotification"
},
{
"$ref": "#/definitions/JSONRPCBatchRequest"
},
{
"$ref": "#/definitions/JSONRPCResponse"
},
{
"$ref": "#/definitions/JSONRPCError"
},
{
"$ref": "#/definitions/JSONRPCBatchResponse"
}
]
}
Variants§
Request(JsonrpcRequest)
Notification(JsonrpcNotification)
BatchRequest(JsonrpcBatchRequest)
Response(JsonrpcResponse)
Error(JsonrpcError)
BatchResponse(JsonrpcBatchResponse)
Trait Implementations§
Source§impl Clone for JsonrpcMessage
impl Clone for JsonrpcMessage
Source§fn clone(&self) -> JsonrpcMessage
fn clone(&self) -> JsonrpcMessage
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for JsonrpcMessage
impl Debug for JsonrpcMessage
Source§impl<'de> Deserialize<'de> for JsonrpcMessage
impl<'de> Deserialize<'de> for JsonrpcMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<JsonrpcBatchRequest> for JsonrpcMessage
impl From<JsonrpcBatchRequest> for JsonrpcMessage
Source§fn from(value: JsonrpcBatchRequest) -> Self
fn from(value: JsonrpcBatchRequest) -> Self
Converts to this type from the input type.
Source§impl From<JsonrpcBatchResponse> for JsonrpcMessage
impl From<JsonrpcBatchResponse> for JsonrpcMessage
Source§fn from(value: JsonrpcBatchResponse) -> Self
fn from(value: JsonrpcBatchResponse) -> Self
Converts to this type from the input type.
Source§impl From<JsonrpcError> for JsonrpcMessage
impl From<JsonrpcError> for JsonrpcMessage
Source§fn from(value: JsonrpcError) -> Self
fn from(value: JsonrpcError) -> Self
Converts to this type from the input type.
Source§impl From<JsonrpcNotification> for JsonrpcMessage
impl From<JsonrpcNotification> for JsonrpcMessage
Source§fn from(value: JsonrpcNotification) -> Self
fn from(value: JsonrpcNotification) -> Self
Converts to this type from the input type.
Source§impl From<JsonrpcRequest> for JsonrpcMessage
impl From<JsonrpcRequest> for JsonrpcMessage
Source§fn from(value: JsonrpcRequest) -> Self
fn from(value: JsonrpcRequest) -> Self
Converts to this type from the input type.
Source§impl From<JsonrpcResponse> for JsonrpcMessage
impl From<JsonrpcResponse> for JsonrpcMessage
Source§fn from(value: JsonrpcResponse) -> Self
fn from(value: JsonrpcResponse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for JsonrpcMessage
impl RefUnwindSafe for JsonrpcMessage
impl Send for JsonrpcMessage
impl Sync for JsonrpcMessage
impl Unpin for JsonrpcMessage
impl UnwindSafe for JsonrpcMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more