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<JsonrpcMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonrpcMessage, <__D as Deserializer<'de>>::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) -> JsonrpcMessage
fn from(value: JsonrpcBatchRequest) -> JsonrpcMessage
Converts to this type from the input type.
Source§impl From<JsonrpcBatchResponse> for JsonrpcMessage
impl From<JsonrpcBatchResponse> for JsonrpcMessage
Source§fn from(value: JsonrpcBatchResponse) -> JsonrpcMessage
fn from(value: JsonrpcBatchResponse) -> JsonrpcMessage
Converts to this type from the input type.
Source§impl From<JsonrpcError> for JsonrpcMessage
impl From<JsonrpcError> for JsonrpcMessage
Source§fn from(value: JsonrpcError) -> JsonrpcMessage
fn from(value: JsonrpcError) -> JsonrpcMessage
Converts to this type from the input type.
Source§impl From<JsonrpcNotification> for JsonrpcMessage
impl From<JsonrpcNotification> for JsonrpcMessage
Source§fn from(value: JsonrpcNotification) -> JsonrpcMessage
fn from(value: JsonrpcNotification) -> JsonrpcMessage
Converts to this type from the input type.
Source§impl From<JsonrpcRequest> for JsonrpcMessage
impl From<JsonrpcRequest> for JsonrpcMessage
Source§fn from(value: JsonrpcRequest) -> JsonrpcMessage
fn from(value: JsonrpcRequest) -> JsonrpcMessage
Converts to this type from the input type.
Source§impl From<JsonrpcResponse> for JsonrpcMessage
impl From<JsonrpcResponse> for JsonrpcMessage
Source§fn from(value: JsonrpcResponse) -> JsonrpcMessage
fn from(value: JsonrpcResponse) -> JsonrpcMessage
Converts to this type from the input type.
Source§impl Serialize for JsonrpcMessage
impl Serialize for JsonrpcMessage
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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