#[non_exhaustive]pub enum JsonError {
Serialize {
source: Error,
},
Deserialize {
source: Error,
},
}Expand description
JsonSerializer failures. Display names the operation, the error class
(serde_json::error::Category), and the line/column — never serde_json::Error’s own
message, which for a data error embeds a fragment of the value it rejected (e.g.
invalid type: string "sk-live-…", expected u64). The full underlying error, message
included, is still reachable via std::error::Error::source for a caller that
deliberately wants it — that caller’s own logging is then responsible for §33.
Debug is a manual impl, never derived: serde_json::Error’s own Debug embeds its
Display message (the same payload fragment Display above must avoid), so deriving
here would leak through {:?} even though Display is safe.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Trait Implementations§
Source§impl Error for JsonError
impl Error for JsonError
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 !RefUnwindSafe for JsonError
impl !UnwindSafe for JsonError
impl Freeze for JsonError
impl Send for JsonError
impl Sync for JsonError
impl Unpin for JsonError
impl UnsafeUnpin 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