Enum async_jsonrpc_client::Output[][src]

pub enum Output<T = Value> {
    Success(Success<T>),
    Failure(Failure),
}

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

Variants

Success(Success<T>)

Success response output

Failure(Failure)

Failure response output

Implementations

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

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

Creates a JSON-RPC 2.0 success response output.

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

Creates a JSON-RPC 2.0 failure response output.

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

Creates a new failure output indicating malformed request.

pub fn version(&self) -> Version[src]

Gets the JSON-RPC protocol version.

pub fn id(&self) -> Option<Id>[src]

Gets the correlation id.

Trait Implementations

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

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

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

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

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

impl<T> PartialEq<Output<T>> for Output<T> where
    T: PartialEq<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.