#[non_exhaustive]pub enum PathSegment {
Field(&'static str),
Index(usize),
MapEntry(usize),
MapKey,
MapValue,
}Expand description
One location segment in a validation path.
Segments sort by variant in the order listed below, then by their field label or numeric index within a variant.
§Examples
use qubit_validator::PathSegment;
let field = PathSegment::Field("profile");
assert_eq!(format!("{field:?}"), "Field(<redacted>)");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.
Field(&'static str)
A declared field name.
Index(usize)
A sequence element index.
MapEntry(usize)
An opaque map entry index.
MapKey
The key side of a map entry.
MapValue
The value side of a map entry.
Trait Implementations§
Source§impl Clone for PathSegment
impl Clone for PathSegment
Source§impl Debug for PathSegment
impl Debug for PathSegment
impl Eq for PathSegment
Source§impl Hash for PathSegment
impl Hash for PathSegment
Source§impl Ord for PathSegment
impl Ord for PathSegment
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for PathSegment
impl PartialEq for PathSegment
Source§impl PartialOrd for PathSegment
impl PartialOrd for PathSegment
impl StructuralPartialEq for PathSegment
Auto Trait Implementations§
impl Freeze for PathSegment
impl RefUnwindSafe for PathSegment
impl Send for PathSegment
impl Sync for PathSegment
impl Unpin for PathSegment
impl UnsafeUnpin for PathSegment
impl UnwindSafe for PathSegment
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