pub struct JsonrpcErrorResponse {
pub error: RpcError,
pub id: Option<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",
"jsonrpc"
],
"properties": {
"error": {
"$ref": "#/$defs/Error"
},
"id": {
"$ref": "#/$defs/RequestId"
},
"jsonrpc": {
"type": "string",
"const": "2.0"
}
}
}Fields§
§error: RpcError§id: Option<RequestId>Implementations§
Source§impl JsonrpcErrorResponse
Constructs a new JsonrpcErrorResponse using the provided arguments.
impl JsonrpcErrorResponse
Constructs a new JsonrpcErrorResponse using the provided arguments.
pub fn create( id: Option<RequestId>, error_code: RpcErrorCodes, error_message: String, error_data: Option<Value>, ) -> JsonrpcErrorResponse
Trait Implementations§
Source§impl Clone for JsonrpcErrorResponse
impl Clone for JsonrpcErrorResponse
Source§fn clone(&self) -> JsonrpcErrorResponse
fn clone(&self) -> JsonrpcErrorResponse
Returns a duplicate 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 JsonrpcErrorResponse
impl Debug for JsonrpcErrorResponse
Source§impl<'de> Deserialize<'de> for JsonrpcErrorResponse
impl<'de> Deserialize<'de> for JsonrpcErrorResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonrpcErrorResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonrpcErrorResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for JsonrpcErrorResponse
Formats the ServerJsonrpcResponse as a JSON string.
impl Display for JsonrpcErrorResponse
Formats the ServerJsonrpcResponse as a JSON string.
Source§impl From<JsonrpcErrorResponse> for JsonrpcMessage
impl From<JsonrpcErrorResponse> for JsonrpcMessage
Source§fn from(value: JsonrpcErrorResponse) -> JsonrpcMessage
fn from(value: JsonrpcErrorResponse) -> JsonrpcMessage
Converts to this type from the input type.
Source§impl From<JsonrpcErrorResponse> for JsonrpcResponse
impl From<JsonrpcErrorResponse> for JsonrpcResponse
Source§fn from(value: JsonrpcErrorResponse) -> JsonrpcResponse
fn from(value: JsonrpcErrorResponse) -> JsonrpcResponse
Converts to this type from the input type.
Source§impl FromStr for JsonrpcErrorResponse
impl FromStr for JsonrpcErrorResponse
Source§impl Serialize for JsonrpcErrorResponse
impl Serialize for JsonrpcErrorResponse
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 JsonrpcErrorResponse
impl RefUnwindSafe for JsonrpcErrorResponse
impl Send for JsonrpcErrorResponse
impl Sync for JsonrpcErrorResponse
impl Unpin for JsonrpcErrorResponse
impl UnwindSafe for JsonrpcErrorResponse
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.