Struct json_rpc_types::Error
source · pub struct Error<T, M = StrBuf<31>> {
pub code: ErrorCode,
pub message: M,
pub data: Option<T>,
}
Expand description
Error object, defined by JSON-RPC
Fields§
§code: ErrorCode
Code
message: M
Message
data: Option<T>
Optional data
Implementations§
source§impl<'a, T, EM: From<&'a str>> Error<T, EM>
impl<'a, T, EM: From<&'a str>> Error<T, EM>
sourcepub fn with_text_message(code: ErrorCode, message: &'a str) -> Self
pub fn with_text_message(code: ErrorCode, message: &'a str) -> Self
Constructs error by converting message from string.
Trait Implementations§
source§impl<'de, T, M> Deserialize<'de> for Error<T, M>where
T: Deserialize<'de>,
M: Deserialize<'de>,
impl<'de, T, M> Deserialize<'de> for Error<T, M>where T: Deserialize<'de>, M: Deserialize<'de>,
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<T: PartialEq, M: PartialEq> PartialEq<Error<T, M>> for Error<T, M>
impl<T: PartialEq, M: PartialEq> PartialEq<Error<T, M>> for Error<T, M>
impl<T, M> StructuralPartialEq for Error<T, M>
Auto Trait Implementations§
impl<T, M> RefUnwindSafe for Error<T, M>where M: RefUnwindSafe, T: RefUnwindSafe,
impl<T, M> Send for Error<T, M>where M: Send, T: Send,
impl<T, M> Sync for Error<T, M>where M: Sync, T: Sync,
impl<T, M> Unpin for Error<T, M>where M: Unpin, T: Unpin,
impl<T, M> UnwindSafe for Error<T, M>where M: UnwindSafe, T: UnwindSafe,
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