pub enum JsonRpcMessage {
Request(JsonRpcRequest),
Response(JsonRpcResponse),
Notification(JsonRpcNotification),
}Expand description
A JSON-RPC 2.0 message (request, response, or notification).
Variants§
Request(JsonRpcRequest)
A request message expecting a response.
Response(JsonRpcResponse)
A response to a previous request.
Notification(JsonRpcNotification)
A notification (no response expected).
Implementations§
Source§impl JsonRpcMessage
impl JsonRpcMessage
Sourcepub fn to_json_value(&self) -> Result<Value>
pub fn to_json_value(&self) -> Result<Value>
Convert this message to a JSON value.
Sourcepub fn from_json_value(value: Value) -> Result<Self>
pub fn from_json_value(value: Value) -> Result<Self>
Parse a JSON-RPC message from a JSON value.
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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