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§
Source§impl 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.
Source§impl 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> 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> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§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, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more