pub struct RpcError {
pub code: ErrorCode,
pub message: Cow<'static, str>,
pub data: Option<Value>,
}
Expand description
Represents a JSON-RPC error
Fields§
§code: ErrorCode
§message: Cow<'static, str>
error message
data: Option<Value>
Implementations§
Source§impl RpcError
impl RpcError
Sourcepub const fn parse_error() -> Self
pub const fn parse_error() -> Self
Creates a new ParseError
error.
Sourcepub const fn method_not_found() -> Self
pub const fn method_not_found() -> Self
Creates a new MethodNotFound
error.
Sourcepub const fn invalid_request() -> Self
pub const fn invalid_request() -> Self
Creates a new InvalidRequest
error.
Sourcepub const fn internal_error() -> Self
pub const fn internal_error() -> Self
Creates a new InternalError
error.
Sourcepub fn invalid_params<M>(message: M) -> Self
pub fn invalid_params<M>(message: M) -> Self
Creates a new InvalidParams
error.
Sourcepub fn internal_error_with<M>(message: M) -> Self
pub fn internal_error_with<M>(message: M) -> Self
Creates a new InternalError
error with a message.
Sourcepub fn transaction_rejected<M>(message: M) -> Self
pub fn transaction_rejected<M>(message: M) -> Self
Creates a new RPC error for when a transaction was rejected.
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 From<RpcError> for ResponseResult
impl From<RpcError> for ResponseResult
Source§impl From<RpcError> for RpcResponse
impl From<RpcError> for RpcResponse
impl Eq for RpcError
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 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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 112 bytes