#[non_exhaustive]pub enum PathAccessError {
RootShapeMismatch {
expected: &'static Shape,
actual: &'static Shape,
},
WrongStepKind {
step: PathStep,
step_index: usize,
shape: &'static Shape,
},
IndexOutOfBounds {
step: PathStep,
step_index: usize,
shape: &'static Shape,
index: usize,
bound: usize,
},
VariantMismatch {
step_index: usize,
shape: &'static Shape,
expected_variant: usize,
actual_variant: usize,
},
MissingTarget {
step: PathStep,
step_index: usize,
shape: &'static Shape,
},
OptionIsNone {
step_index: usize,
shape: &'static Shape,
},
}Expand description
Error returned when navigating a value using a Path.
Each variant captures enough context for a caller to produce a meaningful diagnostic without re-walking the path.
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.
RootShapeMismatch
The root shape of the path doesn’t match the value being navigated.
Fields
WrongStepKind
The step kind doesn’t apply to the current shape.
For example, PathStep::Field on a scalar, or PathStep::Index on a struct.
Fields
IndexOutOfBounds
A field or list index is out of bounds.
Fields
VariantMismatch
The path says we should be at variant X, but the live value is variant Y.
Fields
MissingTarget
A Deref, Inner, or Proxy step has no target.
This can happen when a smart pointer has no borrow_fn,
or the shape has no inner, or no proxy definition.
Fields
OptionIsNone
An OptionSome step was encountered but the value is None.
Trait Implementations§
Source§impl Clone for PathAccessError
impl Clone for PathAccessError
Source§fn clone(&self) -> PathAccessError
fn clone(&self) -> PathAccessError
Returns a duplicate of the value. Read more
1.0.0 · 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 PathAccessError
impl Debug for PathAccessError
Source§impl Display for PathAccessError
impl Display for PathAccessError
Source§impl Error for PathAccessError
impl Error for PathAccessError
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 PathAccessError
impl RefUnwindSafe for PathAccessError
impl Send for PathAccessError
impl Sync for PathAccessError
impl Unpin for PathAccessError
impl UnsafeUnpin for PathAccessError
impl UnwindSafe for PathAccessError
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