[][src]Struct async_json_rpc::objects::Response

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

Represents the JSONRPC response object.

Fields

result: Option<Value>error: Option<RpcError>id: Valuejsonrpc: Option<String>

Implementations

impl Response[src]

pub fn result<T: DeserializeOwned>(&self) -> Option<Result<T, JsonError>>[src]

Extract the result.

pub fn into_result<T: DeserializeOwned>(self) -> Option<Result<T, JsonError>>[src]

Extract the result, consuming the response.

pub fn error(self) -> Option<RpcError>[src]

Returns the RpcError.

pub fn is_result(&self) -> bool[src]

Returns true if the result field is Some value.

pub fn is_error(&self) -> bool[src]

Returns true if the error field is Some value.

Trait Implementations

impl Clone for Response[src]

impl Debug for Response[src]

impl<'de> Deserialize<'de> for Response[src]

impl PartialEq<Response> for Response[src]

impl StructuralPartialEq for Response[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.