[][src]Struct rvk::error::APIError

pub struct APIError { /* fields omitted */ }

An error returned by the API.

Implementations

impl APIError[src]

pub fn new(code: u64, msg: String, extra: HashMap<String, Value>) -> Self[src]

Creates a new APIError.

pub fn code(&self) -> u64[src]

Returns the code of this APIError.


let err = APIError::new(0, "test".into(), HashMap::new());
assert_eq!(err.code(), 0);

pub fn msg(&self) -> &String[src]

Returns the message of this APIError.


let err = APIError::new(0, "test".into(), HashMap::new());
assert_eq!(err.msg(), "test");

pub fn extra(&self) -> &HashMap<String, Value>[src]

Returns the extra fields of this APIError.


let err = APIError::new(0, "test".into(), HashMap::new());
assert_eq!(err.extra().clone(), HashMap::<String, Value>::new());

Trait Implementations

impl Clone for APIError[src]

impl Debug for APIError[src]

impl<'de> Deserialize<'de> for APIError[src]

impl From<APIError> for Error[src]

impl PartialEq<APIError> for APIError[src]

impl Serialize for APIError[src]

impl StructuralPartialEq for APIError[src]

Auto Trait Implementations

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> Instrument for T[src]

impl<T> Instrument 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, 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.