pub struct JsonrpcError {
pub error: RpcError,
pub id: RequestId,
/* private fields */
}
Expand description
A response to a request that indicates an error occurred.
JSON schema
{
"description": "A response to a request that indicates an error occurred.",
"type": "object",
"required": [
"error",
"id",
"jsonrpc"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"description": "The error type that occurred.",
"type": "integer"
},
"data": {
"description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)."
},
"message": {
"description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
"type": "string"
}
}
},
"id": {
"$ref": "#/definitions/RequestId"
},
"jsonrpc": {
"type": "string",
"const": "2.0"
}
}
}
Fields§
§error: RpcError
§id: RequestId
Implementations§
Source§impl JsonrpcError
impl JsonrpcError
Source§impl JsonrpcError
Constructs a new JsonrpcError using the provided arguments.
impl JsonrpcError
Constructs a new JsonrpcError using the provided arguments.
pub fn create( id: RequestId, error_code: RpcErrorCodes, error_message: String, error_data: Option<Value>, ) -> JsonrpcError
Trait Implementations§
Source§impl Clone for JsonrpcError
impl Clone for JsonrpcError
Source§fn clone(&self) -> JsonrpcError
fn clone(&self) -> JsonrpcError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for JsonrpcError
impl Debug for JsonrpcError
Source§impl<'de> Deserialize<'de> for JsonrpcError
impl<'de> Deserialize<'de> for JsonrpcError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonrpcError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonrpcError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for JsonrpcError
Formats the ServerJsonrpcResponse as a JSON string.
impl Display for JsonrpcError
Formats the ServerJsonrpcResponse as a JSON string.
Source§impl From<JsonrpcError> for JsonrpcBatchResponseItem
impl From<JsonrpcError> for JsonrpcBatchResponseItem
Source§fn from(value: JsonrpcError) -> JsonrpcBatchResponseItem
fn from(value: JsonrpcError) -> JsonrpcBatchResponseItem
Converts to this type from the input type.
Source§impl From<JsonrpcError> for JsonrpcMessage
impl From<JsonrpcError> for JsonrpcMessage
Source§fn from(value: JsonrpcError) -> JsonrpcMessage
fn from(value: JsonrpcError) -> JsonrpcMessage
Converts to this type from the input type.
Source§impl FromStr for JsonrpcError
impl FromStr for JsonrpcError
Source§impl Serialize for JsonrpcError
impl Serialize for JsonrpcError
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for JsonrpcError
impl RefUnwindSafe for JsonrpcError
impl Send for JsonrpcError
impl Sync for JsonrpcError
impl Unpin for JsonrpcError
impl UnwindSafe for JsonrpcError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.