pub struct RpcError { /* private fields */ }Expand description
JSON-RPC 2.0 error object returned inside RpcResponse.
Implementations§
Source§impl RpcError
Inherent implementation of RpcError.
impl RpcError
Inherent implementation of RpcError.
Sourcepub fn parse_error() -> Self
pub fn parse_error() -> Self
Sourcepub fn invalid_request() -> Self
pub fn invalid_request() -> Self
Sourcepub fn method_not_found() -> Self
pub fn method_not_found() -> Self
Builds a JSON-RPC 2.0 Method Not Found error (-32601).
§Returns
Self- Method not found error object.
Sourcepub fn invalid_params(data: Option<Value>) -> Self
pub fn invalid_params(data: Option<Value>) -> Self
Sourcepub fn internal_error(data: Option<Value>) -> Self
pub fn internal_error(data: Option<Value>) -> Self
Source§impl RpcError
impl RpcError
pub fn get_code(&self) -> i64
pub fn get_mut_code(&mut self) -> &mut i64
pub fn set_code(&mut self, val: i64) -> &mut Self
pub fn get_message(&self) -> &String
pub fn get_mut_message(&mut self) -> &mut String
pub fn set_message(&mut self, val: String) -> &mut Self
pub fn get_data(&self) -> Option<Value>
pub fn try_get_data(&self) -> Option<Value>
pub fn get_mut_data(&mut self) -> &mut Option<Value>
pub fn set_data(&mut self, val: Option<Value>) -> &mut Self
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
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()
impl StructuralPartialEq for RpcError
Auto Trait Implementations§
impl Forget for RpcError
impl Freeze for RpcErrorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for RpcError
impl RefUnwindSafe for RpcError
impl Send for RpcError
impl Sync for RpcError
impl Unpin for RpcError
impl UnsafeUnpin for RpcErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for RpcError
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.