pub enum DecodeError {
Json,
InvalidRequest(&'static str),
EmptyBatch,
}Expand description
Why a frame could not be decoded.
Variants§
Json
The bytes were not JSON at all (-32700).
InvalidRequest(&'static str)
The frame was JSON but not a JSON-RPC message (-32600).
This is the single bucket for every shape problem: not an object, a
missing or wrong jsonrpc member, a method next to a result, an id
that is not a number or a string. The specification gives all of them
the same code, and a peer gets nothing useful from a more precise one.
EmptyBatch
A batch frame was empty (-32600).
Implementations§
Source§impl DecodeError
impl DecodeError
Sourcepub const fn code(self) -> IrErrorCode
pub const fn code(self) -> IrErrorCode
The JSON-RPC code this failure must be reported as.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
impl Copy for DecodeError
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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<'a> From<DecodeError> for RouteError<'a>
impl<'a> From<DecodeError> for RouteError<'a>
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
impl StructuralPartialEq for DecodeError
Auto Trait Implementations§
impl Freeze for DecodeError
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnsafeUnpin for DecodeError
impl UnwindSafe for DecodeError
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