#[non_exhaustive]pub enum JsonFromStrError {
Parse(JsonError),
Decode(JsonDecodeError),
}Expand description
The error type of from_json_str: either the input
was not valid JSON, or the parsed value did not match the target type.
#[non_exhaustive]: new variants may be added in a future release.
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.
Parse(JsonError)
The input was not valid JSON.
Decode(JsonDecodeError)
The JSON parsed but did not match the target type.
Trait Implementations§
Source§impl Clone for JsonFromStrError
impl Clone for JsonFromStrError
Source§fn clone(&self) -> JsonFromStrError
fn clone(&self) -> JsonFromStrError
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 moreSource§impl Debug for JsonFromStrError
impl Debug for JsonFromStrError
Source§impl Display for JsonFromStrError
impl Display for JsonFromStrError
impl Eq for JsonFromStrError
Source§impl Error for JsonFromStrError
Available on crate feature std only.
impl Error for JsonFromStrError
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 From<JsonError> for JsonFromStrError
impl From<JsonError> for JsonFromStrError
Source§impl PartialEq for JsonFromStrError
impl PartialEq for JsonFromStrError
Source§fn eq(&self, other: &JsonFromStrError) -> bool
fn eq(&self, other: &JsonFromStrError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for JsonFromStrError
Auto Trait Implementations§
impl Freeze for JsonFromStrError
impl RefUnwindSafe for JsonFromStrError
impl Send for JsonFromStrError
impl Sync for JsonFromStrError
impl Unpin for JsonFromStrError
impl UnsafeUnpin for JsonFromStrError
impl UnwindSafe for JsonFromStrError
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