pub struct Error { /* private fields */ }Expand description
A parse error produced when the input is not well-formed JSON.
Carries the byte offset and line/column position of the failure, and an
ErrorKind that describes what was wrong.
Implementations§
Source§impl Error
impl Error
Sourcepub fn byte_offset(&self) -> usize
pub fn byte_offset(&self) -> usize
Byte offset of the error location.
Sourcepub fn kind(&self) -> &ErrorKind
pub fn kind(&self) -> &ErrorKind
Return a reference to the details about the error that occurred.
Sourcepub fn into_kind(self) -> ErrorKind
pub fn into_kind(self) -> ErrorKind
Consume the Error and return the details about the error that occurred.
Sourcepub fn into_parts(self) -> (usize, ErrorKind)
pub fn into_parts(self) -> (usize, ErrorKind)
Consume the Error and return the byte offset of the error location and the details of the
error that occurred.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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