Struct diem_sdk::client::errors::JsonRpcError
pub struct JsonRpcError {
pub code: i16,
pub message: String,
pub data: Option<ErrorData>,
}
Fields§
§code: i16
§message: String
§data: Option<ErrorData>
Implementations§
§impl JsonRpcError
impl JsonRpcError
pub fn serialize(self) -> Value
pub fn invalid_request() -> JsonRpcError
pub fn invalid_request_with_data(data: Option<ErrorData>) -> JsonRpcError
pub fn invalid_request_with_msg(msg: String) -> JsonRpcError
pub fn invalid_format() -> JsonRpcError
pub fn invalid_params(method_name: &str) -> JsonRpcError
pub fn invalid_params_size(msg: String) -> JsonRpcError
pub fn invalid_param(msg: &str) -> JsonRpcError
pub fn method_not_found() -> JsonRpcError
pub fn internal_error(message: String) -> JsonRpcError
pub fn code_as_str(&self) -> &'static str
pub fn mempool_error(error: MempoolStatus) -> Result<JsonRpcError, Error>
pub fn vm_status(error: StatusCode) -> JsonRpcError
pub fn as_status_code(&self) -> Option<StatusCode>
Trait Implementations§
§impl Clone for JsonRpcError
impl Clone for JsonRpcError
§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 more§impl Debug for JsonRpcError
impl Debug for JsonRpcError
§impl<'de> Deserialize<'de> for JsonRpcError
impl<'de> Deserialize<'de> for JsonRpcError
§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
§impl Display for JsonRpcError
impl Display for JsonRpcError
§impl Error for JsonRpcError
impl Error for JsonRpcError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
§impl From<Error> for JsonRpcError
impl From<Error> for JsonRpcError
§fn from(err: Error) -> JsonRpcError
fn from(err: Error) -> JsonRpcError
Converts to this type from the input type.
§impl From<Error> for JsonRpcError
impl From<Error> for JsonRpcError
§fn from(err: Error) -> JsonRpcError
fn from(err: Error) -> JsonRpcError
Converts to this type from the input type.
§impl From<Error> for JsonRpcError
impl From<Error> for JsonRpcError
§fn from(err: Error) -> JsonRpcError
fn from(err: Error) -> JsonRpcError
Converts to this type from the input type.
§impl Serialize for JsonRpcError
impl Serialize for JsonRpcError
§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 RefUnwindSafe for JsonRpcError
impl Send for JsonRpcError
impl Sync for JsonRpcError
impl Unpin for JsonRpcError
impl UnwindSafe for JsonRpcError
Blanket Implementations§
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>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.