pub struct JsonError {
pub line: usize,
pub column: usize,
pub message: String,
pub code: Option<Code>,
}Fields§
§line: usize§column: usize§message: String§code: Option<Code>Set when the document was refused for exceeding a limit rather than for being malformed.
The limits exist to stop a hostile document from being built at all, so they are checked here rather than after parsing — which means there is no path to report, only a position. The code is what a caller acts on, and it is the same code the validator would have produced had the same payload arrived as host objects.
Implementations§
Source§impl JsonError
impl JsonError
pub fn as_validation(&self) -> Option<ValidationError>
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