Struct clightningrpc::Response [−][src]
pub struct Response { pub result: Option<Json>, pub error: Option<RpcError>, pub id: Json, pub jsonrpc: Option<String>, }
A JSONRPC response object
Fields
result: Option<Json>
A result if there is one, or null
error: Option<RpcError>
An error if there is one, or null
id: Json
Identifier for this Request, which should match that of the request
jsonrpc: Option<String>
jsonrpc field, MUST be "2.0"
Methods
impl Response
[src]
impl Response
pub fn result<T: DeserializeOwned>(&self) -> Result<T, Error>
[src]
pub fn result<T: DeserializeOwned>(&self) -> Result<T, Error>
Extract the result from a response
pub fn into_result<T: DeserializeOwned>(self) -> Result<T, Error>
[src]
pub fn into_result<T: DeserializeOwned>(self) -> Result<T, Error>
Extract the result from a response, consuming the response
pub fn check_error(self) -> Result<(), Error>
[src]
pub fn check_error(self) -> Result<(), Error>
Return the RPC error, if there was one, but do not check the result
pub fn is_none(&self) -> bool
[src]
pub fn is_none(&self) -> bool
Returns whether or not the result
field is empty
Trait Implementations
impl Debug for Response
[src]
impl Debug for Response
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Response
[src]
impl Clone for Response
fn clone(&self) -> Response
[src]
fn clone(&self) -> Response
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for Response
[src]
impl PartialEq for Response