Struct diem_json_rpc_types::errors::JsonRpcError
source · pub struct JsonRpcError {
pub code: i16,
pub message: String,
pub data: Option<ErrorData>,
}
Fields§
§code: i16
§message: String
§data: Option<ErrorData>
Implementations§
source§impl JsonRpcError
impl JsonRpcError
pub fn serialize(self) -> Value
pub fn invalid_request() -> Self
pub fn invalid_request_with_data(data: Option<ErrorData>) -> Self
pub fn invalid_request_with_msg(msg: String) -> Self
pub fn invalid_format() -> Self
pub fn invalid_params(method_name: &str) -> Self
pub fn invalid_params_size(msg: String) -> Self
pub fn invalid_param(msg: &str) -> Self
pub fn method_not_found() -> Self
pub fn internal_error(message: String) -> Self
pub fn code_as_str(&self) -> &'static str
pub fn mempool_error(error: MempoolStatus) -> Result<Self>
pub fn vm_status(error: StatusCode) -> Self
pub fn as_status_code(&self) -> Option<StatusCode>
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<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
source§impl Display for JsonRpcError
impl Display for JsonRpcError
source§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()
source§impl From<Error> for JsonRpcError
impl From<Error> for JsonRpcError
source§impl From<Error> for JsonRpcError
impl From<Error> for JsonRpcError
source§impl From<Error> for JsonRpcError
impl From<Error> for JsonRpcError
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§
§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.