Struct jsonrpc::Response [] [src]

pub struct Response {
    pub result: Option<Value>,
    pub error: Option<RpcError>,
    pub id: Value,
}

A JSONRPC response object

Fields

result: Option<Value>

A result if there is one, or null

error: Option<RpcError>

An error if there is one, or null

id: Value

Identifier from the request

Methods

impl Response
[src]

fn result<T: Deserialize>(&self) -> Result<T, Error>

Extract the result from a response

fn into_result<T: Deserialize>(self) -> Result<T, Error>

Extract the result from a response, consuming the response

fn check_error(self) -> Result<()Error>

Return the RPC error, if there was one, but do not check the result

Trait Implementations

impl PartialEq for Response
[src]

fn eq(&self, __arg_0: &Response) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Response) -> bool

This method tests for !=.

impl Debug for Response
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for Response
[src]

fn clone(&self) -> Response

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Serialize for Response
[src]

fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer

Serializes this value into this serializer.

impl Deserialize for Response
[src]

fn deserialize<D>(deserializer: &mut D) -> Result<Response, D::Error> where D: Deserializer

Deserialize this value given this Deserializer.