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
impl<T, M> StructuralPartialEq for Error<T, M>
Auto Trait Implementations§
impl<T, M> Freeze for Error<T, M>
impl<T, M> RefUnwindSafe for Error<T, M>where
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, M> Send for Error<T, M>
impl<T, M> Sync for Error<T, M>
impl<T, M> Unpin for Error<T, M>
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