[][src]Enum exonum_explorer::api::websocket::Response

pub enum Response<T> {
    Success {
        response: T,
    },
    Error {
        description: String,
    },
}

Response to a WebSocket client. Roughly equivalent to Result<T, String>.

Variants

Success

Successful response.

Fields of Success

response: T

Payload attached to the response.

Error

Response carrying an error.

Fields of Error

description: String

Error description.

Methods

impl<T> Response<T>[src]

pub fn success(value: T) -> Self[src]

Creates a response with the specified value.

pub fn error(description: impl Display) -> Self[src]

Creates an erroneous response.

pub fn into_result(self) -> Result<T, String>[src]

Converts response into a Result.

Trait Implementations

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

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

impl<T> From<Result<T, String>> for Response<T>[src]

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

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

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

Auto Trait Implementations

impl<T> RefUnwindSafe for Response<T> where
    T: RefUnwindSafe

impl<T> Send for Response<T> where
    T: Send

impl<T> Sync for Response<T> where
    T: Sync

impl<T> Unpin for Response<T> where
    T: Unpin

impl<T> UnwindSafe for Response<T> where
    T: UnwindSafe

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,