Struct tamasfe_json_rpc_types::Response[][src]

pub struct Response<R = ()> {
    pub jsonrpc: &'static str,
    pub id: RequestId,
    pub result: Option<R>,
    pub error: Option<Error>,
}

Fields

jsonrpc: &'static strid: RequestIdresult: Option<R>error: Option<Error>

Implementations

impl<R> Response<R>[src]

pub fn with_request_id(self, id: RequestId) -> Self[src]

impl<R: Serialize + DeserializeOwned> Response<R>[src]

pub fn success(data: R) -> Self[src]

pub fn into_result(self) -> Result<R, Error>[src]

pub fn into_message(self) -> Message[src]

impl Response<Value>[src]

impl Response<()>[src]

pub fn error(err: Error) -> Self[src]

Trait Implementations

impl<R: Debug> Debug for Response<R>[src]

impl<'de, R> Deserialize<'de> for Response<R> where
    R: Deserialize<'de>, 
[src]

impl<R: Eq> Eq for Response<R>[src]

impl<E, R> From<Result<R, E>> for Response<R> where
    R: Serialize + for<'r> Deserialize<'r>,
    E: Into<Error>, 
[src]

impl<R: PartialEq> PartialEq<Response<R>> for Response<R>[src]

impl<R> Serialize for Response<R> where
    R: Serialize
[src]

impl<R> StructuralEq for Response<R>[src]

impl<R> StructuralPartialEq for Response<R>[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for Response<R> where
    R: RefUnwindSafe
[src]

impl<R> Send for Response<R> where
    R: Send
[src]

impl<R> Sync for Response<R> where
    R: Sync
[src]

impl<R> Unpin for Response<R> where
    R: Unpin
[src]

impl<R> UnwindSafe for Response<R> where
    R: UnwindSafe
[src]

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, 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.