Struct async_jsonrpc_client::v2::Error[][src]

pub struct Error {
    pub code: ErrorCode,
    pub message: String,
    pub data: Option<Value>,
}

JSON-RPC Error Object.

Fields

code: ErrorCode

A Number that indicates the error type that occurred. This MUST be an integer.

message: String

A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.

data: Option<Value>

A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).

Implementations

impl Error[src]

pub fn new(code: ErrorCode) -> Error[src]

Wraps given ErrorCode.

pub fn parse_error() -> Error[src]

Creates a new ParseError error.

pub fn invalid_request() -> Error[src]

Creates a new InvalidRequest error.

pub fn method_not_found() -> Error[src]

Creates a new MethodNotFound error.

pub fn invalid_params<M>(message: M) -> Error where
    M: Display
[src]

Creates a new InvalidParams error with given message.

pub fn invalid_params_with_details<M, D>(message: M, details: D) -> Error where
    M: Display,
    D: Display
[src]

Creates a new InvalidParams error with given message and details.

pub fn internal_error() -> Error[src]

Creates a new InternalError error.

pub fn invalid_version() -> Error[src]

Creates a new InvalidRequest error with invalid version description.

Trait Implementations

impl Clone for Error[src]

impl Debug for Error[src]

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

impl Display for Error[src]

impl Eq for Error[src]

impl Error for Error[src]

impl PartialEq<Error> for Error[src]

impl Serialize for Error[src]

impl StructuralEq for Error[src]

impl StructuralPartialEq for Error[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, 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.