pub struct JsonRpcResponse {
pub jsonrpc: String,
pub id: u64,
pub result: Option<Value>,
pub error: Option<JsonRpcError>,
}Expand description
A JSON-RPC 2.0 response message.
Represents a response from server to client, containing either a result
or an error. The id field matches the corresponding request.
§Fields
jsonrpc- Protocol version, always “2.0”id- Request identifier this response corresponds toresult- Successful result (mutually exclusive with error)error- Error information if the request failed
§Note
Either result or error will be present, never both.
Fields§
§jsonrpc: StringJSON-RPC protocol version (always “2.0”)
id: u64Request identifier this response corresponds to
result: Option<Value>Successful result data (present on success)
error: Option<JsonRpcError>Error information (present on failure)
Trait Implementations§
Source§impl Clone for JsonRpcResponse
impl Clone for JsonRpcResponse
Source§fn clone(&self) -> JsonRpcResponse
fn clone(&self) -> JsonRpcResponse
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 JsonRpcResponse
impl Debug for JsonRpcResponse
Source§impl<'de> Deserialize<'de> for JsonRpcResponse
impl<'de> Deserialize<'de> for JsonRpcResponse
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 JsonRpcResponse
impl RefUnwindSafe for JsonRpcResponse
impl Send for JsonRpcResponse
impl Sync for JsonRpcResponse
impl Unpin for JsonRpcResponse
impl UnsafeUnpin for JsonRpcResponse
impl UnwindSafe for JsonRpcResponse
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