Enum jrpc::ErrorCode [] [src]

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

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

Methods

impl ErrorCode
[src]

[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 Serialize for ErrorCode
[src]

[src]

Serialize this value into the given Serde serializer. Read more

impl Expected for ErrorCode
[src]

[src]

Format an explanation of what data was being expected. Same signature as the Display and Debug traits. Read more

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

[src]

Deserialize this value from the given Serde deserializer. Read more

impl Debug for ErrorCode
[src]

[src]

Formats the value using the given formatter. Read more

impl Copy for ErrorCode
[src]

impl Clone for ErrorCode
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for ErrorCode
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for ErrorCode
[src]

impl Hash for ErrorCode
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Ord for ErrorCode
[src]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl PartialOrd for ErrorCode
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl From<i64> for ErrorCode
[src]

[src]

Performs the conversion.

Auto Trait Implementations

impl Send for ErrorCode

impl Sync for ErrorCode