pub struct RpcError {
pub code: i32,
pub message: String,
}Expand description
What a JSON-RPC response states in its error member.
Fields§
§code: i32The code this failure carries.
message: StringThe message this failure states.
Implementations§
Source§impl RpcError
impl RpcError
Sourcepub fn denoted<Failure>(failure: &Failure) -> Selfwhere
Failure: RpcErrorAlg,
pub fn denoted<Failure>(failure: &Failure) -> Selfwhere
Failure: RpcErrorAlg,
Reads the error a domain failure denotes.
Sourcepub fn parse_error() -> Self
pub fn parse_error() -> Self
States that a document is not JSON.
Sourcepub fn invalid_request() -> Self
pub fn invalid_request() -> Self
States that a document is JSON but not a JSON-RPC request.
Sourcepub fn method_not_found(method: &str) -> Self
pub fn method_not_found(method: &str) -> Self
States that no method answers to a name.
Trait Implementations§
impl Eq for RpcError
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)>
Returns 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 RpcErrorAlg for RpcError
A domain can answer with this error directly, stating its own code and message.
impl RpcErrorAlg for RpcError
A domain can answer with this error directly, stating its own code and message.
impl StructuralPartialEq for RpcError
Auto Trait Implementations§
impl Freeze for RpcError
impl RefUnwindSafe for RpcError
impl Send for RpcError
impl Sync for RpcError
impl Unpin for RpcError
impl UnsafeUnpin for RpcError
impl UnwindSafe for RpcError
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<This> JsonRpcProgramExt<This> for This
impl<This> JsonRpcProgramExt<This> for This
Source§fn compile_jsonrpc<Program>(
&self,
program: Program,
) -> <Program as JsonRpcProgramAlg<This>>::Methodswhere
Program: JsonRpcProgramAlg<This>,
fn compile_jsonrpc<Program>(
&self,
program: Program,
) -> <Program as JsonRpcProgramAlg<This>>::Methodswhere
Program: JsonRpcProgramAlg<This>,
Compiles a named JSON-RPC program with this interpreter.