pub struct RpcError {
pub code: i64,
pub message: String,
pub data: Option<Value>,
}Expand description
Represents the JSON-RPC 2.0 Error Object. https://www.jsonrpc.org/specification#error_object
Fields§
§code: i64A Number that indicates the error type that occurred.
message: StringA String providing a short description of the error.
data: Option<Value>A Primitive or Structured value that contains additional information about the error. This may be omitted.
Implementations§
Source§impl RpcError
impl RpcError
pub const CODE_PARSE_ERROR: i64 = -32_700i64
pub const CODE_INVALID_REQUEST: i64 = -32_600i64
pub const CODE_METHOD_NOT_FOUND: i64 = -32_601i64
pub const CODE_INVALID_PARAMS: i64 = -32_602i64
pub const CODE_INTERNAL_ERROR: i64 = -32_603i64
pub fn from_parse_error(data: Option<Value>) -> Self
pub fn from_invalid_request(data: Option<Value>) -> Self
pub fn from_method_not_found(data: Option<Value>) -> Self
pub fn from_invalid_params(data: Option<Value>) -> Self
pub fn from_internal_error(data: Option<Value>) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RpcError
impl<'de> Deserialize<'de> for RpcError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for RpcError
Auto Trait Implementations§
impl Freeze for RpcError
impl RefUnwindSafe for RpcError
impl Send for RpcError
impl Sync for RpcError
impl Unpin for RpcError
impl UnwindSafe for RpcError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more