[][src]Struct factom::responses::ApiResponse

pub struct ApiResponse<T> where
    T: Default
{ pub jsonrpc: String, pub id: u32, pub result: T, pub error: ApiError, }

JSON responses are deserialized into this struct

Fields

jsonrpc: Stringid: u32result: Terror: ApiError

Methods

impl<T> ApiResponse<T> where
    T: Default
[src]

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

Returns a boolean representing whether the api response returned an error This function does not deal with network errors, that is handled earlier by the Result from running the future query to completion.

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

Returns a boolean representing whether the api response returned an error This function does not deal with network errors, that is handled earlier by the Result from running the future query to completion.

Trait Implementations

impl<T: Debug> Debug for ApiResponse<T> where
    T: Default
[src]

impl<T: Default> Default for ApiResponse<T> where
    T: Default
[src]

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

impl<T> Display for ApiResponse<T> where
    T: Default + Debug + Display
[src]

impl<T> Error for ApiResponse<T> where
    T: Default + Debug + Display
[src]

impl<T: PartialEq> PartialEq<ApiResponse<T>> for ApiResponse<T> where
    T: Default
[src]

impl<T> StructuralPartialEq for ApiResponse<T> where
    T: Default
[src]

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for ApiResponse<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> 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.