pub struct FieldPath(/* private fields */);input-toml or input-yaml only.Expand description
The steps from a document’s root down to a field.
Build one with FieldPath::root, FieldPath::key, and
FieldPath::index, or, with the validate feature, from garde’s path
with FieldPath::from. Input::place turns it into
a line and column.
A key is kept as written, so
FieldPath::root().key("files").key("docs/**/*.md") names one key of
files, not four. Display joins the steps the way garde prints a field,
files.docs/**/*.md, which cannot tell a key that holds a dot from nesting.
It is for people, and nothing reads it back.
Implementations§
Trait Implementations§
Source§impl Display for FieldPath
The path as garde prints a field: keys joined by ., indexes in brackets,
and nothing for the root.
impl Display for FieldPath
The path as garde prints a field: keys joined by ., indexes in brackets,
and nothing for the root.
impl Eq for FieldPath
Source§impl From<&Path> for FieldPath
Available on crate feature validate only.The steps of garde’s path, read from its parts and never from its printed
string, so a key that holds a . stays one step.
impl From<&Path> for FieldPath
validate only.The steps of garde’s path, read from its parts and never from its printed
string, so a key that holds a . stays one step.
A component garde marks as an index becomes Step::Index, one it marks as
a key becomes Step::Key, and one it marks with no key, which names a
wrapper such as a one-field tuple struct, is dropped. An index component
that is not a number is kept as a key.
impl StructuralPartialEq for FieldPath
Auto Trait Implementations§
impl Forget for FieldPath
impl Freeze for FieldPath
impl Move for FieldPath
impl RefUnwindSafe for FieldPath
impl Send for FieldPath
impl Sync for FieldPath
impl Unpin for FieldPath
impl UnsafeUnpin for FieldPath
impl UnwindSafe for FieldPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
fn validate_matches(&self, other: &O) -> bool
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more