pub enum JsonRpcMessage {
Request(JsonRpcRequest),
Response(JsonRpcResponse),
Notification(JsonRpcNotification),
}Expand description
A parsed JSON-RPC 2.0 message — request, response, or notification.
Variants§
Request(JsonRpcRequest)
An incoming or outgoing request.
Response(JsonRpcResponse)
A response to a previous request.
Notification(JsonRpcNotification)
A fire-and-forget notification.
Trait Implementations§
Source§impl Clone for JsonRpcMessage
impl Clone for JsonRpcMessage
Source§fn clone(&self) -> JsonRpcMessage
fn clone(&self) -> JsonRpcMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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
Custom deserializer that dispatches based on field presence instead of
#[serde(untagged)] which tries each variant sequentially (3× parse
attempts for Notification — the hot-path streaming variant).
impl<'de> Deserialize<'de> for JsonRpcMessage
Custom deserializer that dispatches based on field presence instead of
#[serde(untagged)] which tries each variant sequentially (3× parse
attempts for Notification — the hot-path streaming variant).
Dispatch logic:
- has
id+ hasmethod→ Request - has
id+ nomethod→ Response - no
id→ Notification
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
Auto Trait Implementations§
impl Freeze for JsonRpcMessage
impl RefUnwindSafe for JsonRpcMessage
impl Send for JsonRpcMessage
impl Sync for JsonRpcMessage
impl Unpin for JsonRpcMessage
impl UnsafeUnpin 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