Struct exonum_jsonrpc::Response
[−]
[src]
pub struct Response { pub result: Option<Value>, pub error: Option<Value>, pub id: Value, }
A JSONRPC response object
Fields
result: Option<Value>
The Object that was returned by the invoked method. This must be null in case there was a error invoking the method
error: Option<Value>
An Error object if there was an error invoking the method. It must be null if there was no error
id: Value
This must be the same id as the request it is responding to
Methods
impl Response
[src]
fn result<T>(&self) -> Result<T, Error> where
T: Deserialize<'de>,
T: Deserialize<'de>,
Extract the result from a response
fn into_result<T>(self) -> Result<T, Error> where
T: Deserialize<'de>,
T: Deserialize<'de>,
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
fn is_none(&self) -> bool
Returns whether or not the result
field is empty
Trait Implementations
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