pub enum JsonRpcMessageResult {
Response(JsonRpcResponse),
Error(JsonRpcError),
NoResponse,
}
Expand description
Result of parsing and processing a JSON-RPC message
Variants§
Response(JsonRpcResponse)
A response to a request
Error(JsonRpcError)
An error response
NoResponse
No response needed (for notifications)
Implementations§
Source§impl JsonRpcMessageResult
impl JsonRpcMessageResult
Sourcepub fn to_json_string(&self) -> Option<String>
pub fn to_json_string(&self) -> Option<String>
Convert to JSON string if there’s a response to send
Sourcepub fn needs_response(&self) -> bool
pub fn needs_response(&self) -> bool
Check if this result needs a response
Trait Implementations§
Source§impl Clone for JsonRpcMessageResult
impl Clone for JsonRpcMessageResult
Source§fn clone(&self) -> JsonRpcMessageResult
fn clone(&self) -> JsonRpcMessageResult
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 JsonRpcMessageResult
impl RefUnwindSafe for JsonRpcMessageResult
impl Send for JsonRpcMessageResult
impl Sync for JsonRpcMessageResult
impl Unpin for JsonRpcMessageResult
impl UnwindSafe for JsonRpcMessageResult
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