pub enum JsonError {
Invalid,
NotAnObject,
PathNotScalar {
path: String,
},
}Expand description
A failure scanning raw JSON bytes.
Deliberately exhaustive (not #[non_exhaustive]): it is a small, closed set
of JSON-shape failures, and downstream From conversions must map every
variant, a new one should be a compile error to handle, not silently fall
through a wildcard.
Variants§
Invalid
The bytes were not valid JSON.
NotAnObject
The document was expected to be a JSON object but was not.
PathNotScalar
A path does not resolve to a scalar value in the document.
Trait Implementations§
impl Eq for JsonError
Source§impl Error for JsonError
impl Error for JsonError
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()
impl StructuralPartialEq for JsonError
Auto Trait Implementations§
impl Freeze for JsonError
impl RefUnwindSafe for JsonError
impl Send for JsonError
impl Sync for JsonError
impl Unpin for JsonError
impl UnsafeUnpin for JsonError
impl UnwindSafe for JsonError
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