pub struct RPCError {
pub kind: RPCErrorKind,
/* private fields */
}
Expand description
RPC error. All functions in RPC traits must return an error type
which implements From<RPCError>
.
Fields§
§kind: RPCErrorKind
Implementations§
source§impl RPCError
impl RPCError
sourcepub fn new(kind: RPCErrorKind, msg: impl Into<String>) -> Self
pub fn new(kind: RPCErrorKind, msg: impl Into<String>) -> Self
New error without a cause.
sourcepub fn with_cause(
kind: RPCErrorKind,
msg: impl Into<String>,
cause: impl Error
) -> Self
pub fn with_cause(
kind: RPCErrorKind,
msg: impl Into<String>,
cause: impl Error
) -> Self
New error with a cause.
sourcepub fn cause<'a>(&'a self) -> Option<&'a GenericSerializableError>
pub fn cause<'a>(&'a self) -> Option<&'a GenericSerializableError>
Get the cause of the error (if any).
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
source§impl Error for RPCError
impl Error for RPCError
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()