pub struct Error { /* private fields */ }Expand description
A JSON error carrying positional information.
Every parse error records the trigger position; byte-stream inputs also carry a precise 1-based line and column.
Implementations§
Source§impl Error
impl Error
Sourcepub fn missing_field(field: &'static str) -> Self
pub fn missing_field(field: &'static str) -> Self
A required field is missing.
Sourcepub fn unknown_field(field: String) -> Self
pub fn unknown_field(field: String) -> Self
An unknown field was encountered.
Sourcepub fn unknown_variant(variant: String) -> Self
pub fn unknown_variant(variant: String) -> Self
An unknown enum variant was encountered.
Sourcepub fn invalid_length(len: usize, expected: &'static str) -> Self
pub fn invalid_length(len: usize, expected: &'static str) -> Self
A length mismatch.
Sourcepub fn invalid_type(expected: &'static str, found: &'static str) -> Self
pub fn invalid_type(expected: &'static str, found: &'static str) -> Self
A type mismatch.
Sourcepub fn classification(&self) -> &'static str
pub fn classification(&self) -> &'static str
Coarse classification of the error.
Trait Implementations§
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
Available on crate feature
std only.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 FormatError for Error
impl FormatError for Error
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