pub struct FieldPath {
pub elements: Vec<FieldPathElement>,
}
Expand description
FieldPath
provides a path to a nested protobuf field.
This message provides enough information to render a dotted field path even without protobuf descriptors. It also provides enough information to resolve a nested field through unknown wire data.
Fields§
§elements: Vec<FieldPathElement>
elements
contains each element of the path, starting from the root and recursing downward.
Implementations§
Source§impl FieldPath
impl FieldPath
Sourcepub fn last_field(&self) -> Option<&FieldPathElement>
pub fn last_field(&self) -> Option<&FieldPathElement>
Returns the last member in the elements list, if the list is not empty.
Sourcepub fn parent_field(&self) -> Option<&FieldPathElement>
pub fn parent_field(&self) -> Option<&FieldPathElement>
Returns the second last member in the elements list, if the list is not empty.
Sourcepub fn has_fields(&self) -> bool
pub fn has_fields(&self) -> bool
Checks if the elements list is empty or not.
Sourcepub fn last_field_name(&self) -> Option<&str>
pub fn last_field_name(&self) -> Option<&str>
Returns the name of the last member in the elements list, if there is one.
Sourcepub fn get_field(&self, name: &str) -> Option<&FieldPathElement>
pub fn get_field(&self, name: &str) -> Option<&FieldPathElement>
Searches for a FieldPathElement by name in the elements list.
Sourcepub fn field_path(&self) -> Vec<String>
pub fn field_path(&self) -> Vec<String>
Returns a vector with the names from each element in the list.
Sourcepub fn field_path_str(&self) -> String
pub fn field_path_str(&self) -> String
Returns all of the names from each path element, joined by a dot (e.g. person.friend.0.address.street_name
)
Trait Implementations§
Source§impl Message for FieldPath
impl Message for FieldPath
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.impl StructuralPartialEq for FieldPath
Auto Trait Implementations§
impl Freeze for FieldPath
impl RefUnwindSafe for FieldPath
impl Send for FieldPath
impl Sync for FieldPath
impl Unpin for FieldPath
impl UnwindSafe for FieldPath
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
pointer