pub enum Path<'a> {
Root,
Seq {
parent: &'a Path<'a>,
index: usize,
},
Map {
parent: &'a Path<'a>,
key: &'a str,
},
Alias {
parent: &'a Path<'a>,
},
Unknown {
parent: &'a Path<'a>,
},
}
Expand description
Path
represents the path to the current value in the input, like dependencies.serde.typo1
.
The Path
enum provides a way to represent different types of paths in a YAML-like structure.
It can be used to track the location of values within the input and provide meaningful error messages.
§Variants
Root
: Represents the root path.Seq
: Represents a sequence (array) path with a reference to the parent path and an index.Map
: Represents a map (object) path with a reference to the parent path and a key.Alias
: Represents an alias path with a reference to the parent path.Unknown
: Represents an unknown path with a reference to the parent path.
Variants§
Root
Represents the root path.
Seq
Represents a sequence (array) path with a reference to the parent path and an index.
Map
Represents a map (object) path with a reference to the parent path and a key.
Alias
Represents an alias path with a reference to the parent path.
Unknown
Represents an unknown path with a reference to the parent path.
Trait Implementations§
impl<'a> Copy for Path<'a>
impl<'a> StructuralPartialEq for Path<'a>
Auto Trait Implementations§
impl<'a> Freeze for Path<'a>
impl<'a> RefUnwindSafe for Path<'a>
impl<'a> Send for Path<'a>
impl<'a> Sync for Path<'a>
impl<'a> Unpin for Path<'a>
impl<'a> UnwindSafe for Path<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)