[][src]Enum jrpc::ErrorCode

pub enum ErrorCode {
    ParseError,
    InvalidRequest,
    MethodNotFound,
    InvalidParams,
    InternalError,
    ServerError(i64),
}

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

The error codes from and including -32768 to -32000 are reserved for pre-defined errors. Any code within this range, but not defined explicitly below is reserved for future use. The error codes are nearly the same as those suggested for XML-RPC at the following url: http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php

Use the is_valid() method to determine compliance.

Variants

ParseError
  • -32700: Parse error. Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
InvalidRequest
  • -32600: Invalid Request. The JSON sent is not a valid Request object.
MethodNotFound
  • -32601: Method not found. The method does not exist / is not available.
InvalidParams
  • -32602: Invalid params. Invalid method parameter(s).
InternalError
  • -32603: Internal error. Internal JSON-RPC error.
ServerError(i64)
  • -32000 to -32099: Server error. Reserved for implementation-defined server-errors.

Methods

impl ErrorCode[src]

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

Return whether the ErrorCode is correct.

This will only return false if this is ServerError and is outside of the range of -32000 to -32099.

Trait Implementations

impl From<i64> for ErrorCode[src]

impl Clone for ErrorCode[src]

impl Copy for ErrorCode[src]

impl Eq for ErrorCode[src]

impl Ord for ErrorCode[src]

impl PartialEq<ErrorCode> for ErrorCode[src]

impl PartialOrd<ErrorCode> for ErrorCode[src]

impl Debug for ErrorCode[src]

impl Hash for ErrorCode[src]

impl Expected for ErrorCode[src]

impl Serialize for ErrorCode[src]

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

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<'de, T> Expected for T where
    T: Visitor<'de>, 
[src]

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