pub struct JsonDecodeError { /* private fields */ }Expand description
An error from decoding a JsonValue into a typed value.
Implementations§
Source§impl JsonDecodeError
impl JsonDecodeError
Sourcepub const fn new(kind: JsonDecodeErrorKind, message: &'static str) -> Self
pub const fn new(kind: JsonDecodeErrorKind, message: &'static str) -> Self
Creates a decode error with a stable kind and an actionable message.
Sourcepub const fn kind(&self) -> JsonDecodeErrorKind
pub const fn kind(&self) -> JsonDecodeErrorKind
Returns the stable error category.
Sourcepub const fn unexpected_type(message: &'static str) -> Self
pub const fn unexpected_type(message: &'static str) -> Self
A value had a different JSON type than expected.
Sourcepub const fn missing_field(message: &'static str) -> Self
pub const fn missing_field(message: &'static str) -> Self
A required object field was missing.
Trait Implementations§
Source§impl Clone for JsonDecodeError
impl Clone for JsonDecodeError
Source§fn clone(&self) -> JsonDecodeError
fn clone(&self) -> JsonDecodeError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for JsonDecodeError
Source§impl Debug for JsonDecodeError
impl Debug for JsonDecodeError
Source§impl Display for JsonDecodeError
impl Display for JsonDecodeError
impl Eq for JsonDecodeError
Source§impl Error for JsonDecodeError
Available on crate feature std only.
impl Error for JsonDecodeError
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 From<JsonDecodeError> for JsonFromStrError
impl From<JsonDecodeError> for JsonFromStrError
Source§fn from(error: JsonDecodeError) -> Self
fn from(error: JsonDecodeError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for JsonDecodeError
impl PartialEq for JsonDecodeError
Source§fn eq(&self, other: &JsonDecodeError) -> bool
fn eq(&self, other: &JsonDecodeError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for JsonDecodeError
Auto Trait Implementations§
impl Freeze for JsonDecodeError
impl RefUnwindSafe for JsonDecodeError
impl Send for JsonDecodeError
impl Sync for JsonDecodeError
impl Unpin for JsonDecodeError
impl UnsafeUnpin for JsonDecodeError
impl UnwindSafe for JsonDecodeError
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