pub enum JsonRpcWireMessage {
Request(JsonRpcRequest),
Notification(JsonRpcNotification),
Response(JsonRpcResponse),
}Expand description
Bidirectional wire-message union (request | notification | response) — the
schema’s JSONRPCMessage. Superset of JsonRpcMessage; for clients and
peers that read responses. Parse with parse_json_rpc_wire_message.
Any single JSON-RPC 2.0 message read off the wire, in either direction.
The Response arm carries a JsonRpcResponse, which is itself the §5
Success | Error union — so one variant covers both response kinds.
Serialization is untagged: a frame serializes to the bare message object,
not an externally-tagged wrapper. Parse incoming bytes with
parse_json_rpc_wire_message; it validates structure rather than relying
on #[serde(untagged)] deserialization, which would silently misclassify
a malformed-id request as a notification.
Variants§
Request(JsonRpcRequest)
A request: has a method and an id, expects a response.
Notification(JsonRpcNotification)
A notification: has a method, no id, expects no response.
Response(JsonRpcResponse)
A response to a previously-sent request (success or error).
Trait Implementations§
Source§impl Clone for JsonRpcWireMessage
impl Clone for JsonRpcWireMessage
Source§fn clone(&self) -> JsonRpcWireMessage
fn clone(&self) -> JsonRpcWireMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more