pub struct Error<S, D> {
pub code: ErrorCode,
pub message: S,
pub data: Option<D>,
}
Expand description
When a rpc call encounters an error, the Response Object MUST contain the error member with a value that is a Object.
Fields§
§code: ErrorCode
A Number that indicates the error type that occurred.
message: S
A String providing a short description of the error. The message SHOULD be limited to a concise single sentence
data: Option<D>
A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).
Implementations§
Trait Implementations§
Source§impl<'de, S, D> Deserialize<'de> for Error<S, D>where
S: Deserialize<'de>,
D: Deserialize<'de>,
impl<'de, S, D> Deserialize<'de> for Error<S, D>where
S: Deserialize<'de>,
D: 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<S, D> Error for Error<S, D>
impl<S, D> Error for Error<S, D>
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 From<CompleteQError> for Error<String, Value>
impl From<CompleteQError> for Error<String, Value>
Source§fn from(err: CompleteQError) -> Self
fn from(err: CompleteQError) -> Self
Converts to this type from the input type.
impl<S, D> StructuralPartialEq for Error<S, D>
Auto Trait Implementations§
impl<S, D> Freeze for Error<S, D>
impl<S, D> RefUnwindSafe for Error<S, D>where
S: RefUnwindSafe,
D: RefUnwindSafe,
impl<S, D> Send for Error<S, D>
impl<S, D> Sync for Error<S, D>
impl<S, D> Unpin for Error<S, D>
impl<S, D> UnwindSafe for Error<S, D>where
S: UnwindSafe,
D: 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