pub enum Path<'a> {
Root(&'static str),
Select(&'a Path<'a>, PathElement),
}Expand description
Used to track a location within a protobuf message. The owned version is PathBuf.
Variants
Root(&'static str)
Refers to the root message.
Select(&'a Path<'a>, PathElement)
Refers to an optional field with the given name within the message referred to by the given parent path.
Implementations
sourceimpl Path<'_>
impl Path<'_>
sourcepub fn with(&self, element: PathElement) -> Path<'_>
pub fn with(&self, element: PathElement) -> Path<'_>
Returns a new Path that references an optional field with the given name within the protobuf message referred to by the current path, or likewise for the key within a YAML map.
sourcepub fn with_field<S: Into<String>>(&self, name: S) -> Path<'_>
pub fn with_field<S: Into<String>>(&self, name: S) -> Path<'_>
Returns a new Path that references an optional field with the given name within the protobuf message referred to by the current path, or likewise for the key within a YAML map.
sourcepub fn with_repeated<S: Into<String>>(&self, name: S, index: usize) -> Path<'_>
pub fn with_repeated<S: Into<String>>(&self, name: S, index: usize) -> Path<'_>
Returns a new Path that references an element of a repeated field with the given name within the message referred to by the current path.
sourcepub fn with_variant<S: Into<String>, V: Into<String>>(
&self,
name: S,
variant: V
) -> Path<'_>
pub fn with_variant<S: Into<String>, V: Into<String>>(
&self,
name: S,
variant: V
) -> Path<'_>
Returns a new Path that references a particular variant of a OneOf field with the given name within the message referred to by the current path.
sourcepub fn with_index(&self, index: usize) -> Path<'_>
pub fn with_index(&self, index: usize) -> Path<'_>
Returns a new Path that references a YAML array element.
sourceimpl Path<'_>
impl Path<'_>
pub fn end_to_string(&self) -> String
sourcepub fn to_path_buf(&self) -> PathBuf
pub fn to_path_buf(&self) -> PathBuf
Creates an owned version of this Path.
Trait Implementations
impl<'a> StructuralPartialEq for Path<'a>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more