pub enum PrevFailure {
NotFound {
arg_path: String,
prev_path: String,
resolved_prefix: String,
missing: String,
available: Vec<String>,
},
WrongType {
arg_path: String,
prev_path: String,
resolved_prefix: String,
segment: String,
expected: &'static str,
found: &'static str,
},
Unsupported {
arg_path: String,
prev_path: String,
segment: String,
},
}Expand description
Explains why a $prev path failed to resolve, for error-message
construction. Distinguishes three mistakes that a single generic
“not found” message conflates:
- the field/index simply isn’t there (
NotFound); - a segment expects an object or array to index into, but the prior
result holds a scalar at that point (
WrongType); - the bracket syntax itself isn’t a supported index form (
Unsupported).
Variants§
NotFound
A path segment names a field or index that does not exist on an otherwise correctly-typed container.
Fields
WrongType
A path segment expects an object (for a field) or an array (for an index) to continue into, but the prior result holds a different JSON type at that point.
Fields
Unsupported
Bracket syntax that is not a valid non-negative-integer index.
Trait Implementations§
Source§impl Clone for PrevFailure
impl Clone for PrevFailure
Source§impl Debug for PrevFailure
impl Debug for PrevFailure
Source§impl Display for PrevFailure
impl Display for PrevFailure
Source§impl PartialEq for PrevFailure
impl PartialEq for PrevFailure
impl StructuralPartialEq for PrevFailure
Auto Trait Implementations§
impl Freeze for PrevFailure
impl RefUnwindSafe for PrevFailure
impl Send for PrevFailure
impl Sync for PrevFailure
impl Unpin for PrevFailure
impl UnsafeUnpin for PrevFailure
impl UnwindSafe for PrevFailure
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