[][src]Struct jsonrpc_types::v1::Output

pub struct Output<T = Value> {
    pub result: Option<T>,
    pub error: Option<Error>,
    pub id: Option<Id>,
}

Represents success / failure output of JSON-RPC 1.0 response.

Fields

result: Option<T>

Successful execution result.

error: Option<Error>

Failed execution error.

id: Option<Id>

Correlation id.

It MUST be the same as the value of the id member in the Request Object.

If there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), it MUST be Null.

Implementations

impl<T: Serialize + DeserializeOwned> Output<T>[src]

pub fn success(result: T, id: Id) -> Self[src]

Creates a JSON-RPC 1.0 success response output.

pub fn failure(error: Error, id: Option<Id>) -> Self[src]

Creates a JSON-RPC 1.0 failure response output.

pub fn invalid_request(id: Option<Id>) -> Self[src]

Creates a new failure response output indicating malformed request.

Trait Implementations

impl<T: Clone> Clone for Output<T>[src]

impl<T: Debug> Debug for Output<T>[src]

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

impl<T: Serialize> Display for Output<T>[src]

impl<T: Eq> Eq for Output<T>[src]

impl<T: PartialEq> PartialEq<Output<T>> for Output<T>[src]

impl<T> Serialize for Output<T> where
    T: Serialize
[src]

impl<T> StructuralEq for Output<T>[src]

impl<T> StructuralPartialEq for Output<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Output<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Output<T> where
    T: Send
[src]

impl<T> Sync for Output<T> where
    T: Sync
[src]

impl<T> Unpin for Output<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Output<T> where
    T: 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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.