#[non_exhaustive]pub enum CanonicalJsonFieldError {
InvalidType {
path: String,
expected: CanonicalJsonType,
found: CanonicalJsonType,
},
Missing {
path: String,
},
}Expand description
Errors that can happen when trying to access a field from a CanonicalJsonObject.
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.
InvalidType
The field at path was expected to be of type expected, but was received as found.
Fields
§
expected: CanonicalJsonTypeThe type that was expected.
§
found: CanonicalJsonTypeThe type that was found.
Missing
A required field is missing from a JSON object.
Trait Implementations§
Source§impl Debug for CanonicalJsonFieldError
impl Debug for CanonicalJsonFieldError
Source§impl Display for CanonicalJsonFieldError
impl Display for CanonicalJsonFieldError
Source§impl Error for CanonicalJsonFieldError
impl Error for CanonicalJsonFieldError
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()
Auto Trait Implementations§
impl Freeze for CanonicalJsonFieldError
impl RefUnwindSafe for CanonicalJsonFieldError
impl Send for CanonicalJsonFieldError
impl Sync for CanonicalJsonFieldError
impl Unpin for CanonicalJsonFieldError
impl UnsafeUnpin for CanonicalJsonFieldError
impl UnwindSafe for CanonicalJsonFieldError
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