pub struct AttributePath {
pub steps: Vec<AttributePathStep>,
}Expand description
Represent the path to an attribute
§Example
let path = AttributePath::new("foo").key("bar").attribute("array").index(1);
// foo["bar"].array[1]Fields§
§steps: Vec<AttributePathStep>Implementations§
Source§impl AttributePath
impl AttributePath
Sourcepub fn function_argument(index: i64) -> Self
pub fn function_argument(index: i64) -> Self
Create a new attribute path for a function argument
§Arguments
index- index of the function argument
Sourcepub fn attribute<T: Into<Cow<'static, str>>>(self, name: T) -> Self
pub fn attribute<T: Into<Cow<'static, str>>>(self, name: T) -> Self
Create a new attribute path where the attribute .name has been appended
§Arguments
name- name of the attribute
Sourcepub fn key<T: Into<Cow<'static, str>>>(self, key: T) -> Self
pub fn key<T: Into<Cow<'static, str>>>(self, key: T) -> Self
Create a new attribute path where the access ["key"] has been appended
§Arguments
key- string subscript
Sourcepub fn index<T: Into<i64>>(self, idx: T) -> Self
pub fn index<T: Into<i64>>(self, idx: T) -> Self
Create a new attribute path where the access [idx] has been appended
§Arguments
idx- integer subscript
Sourcepub fn add_attribute<T: Into<Cow<'static, str>>>(
&mut self,
name: T,
) -> &mut Self
pub fn add_attribute<T: Into<Cow<'static, str>>>( &mut self, name: T, ) -> &mut Self
Sourcepub fn add_step(&mut self, step: AttributePathStep) -> &mut Self
pub fn add_step(&mut self, step: AttributePathStep) -> &mut Self
Sourcepub fn add_steps(&mut self, steps: AttributePath) -> &mut Self
pub fn add_steps(&mut self, steps: AttributePath) -> &mut Self
Trait Implementations§
Source§impl Add<AttributePathStep> for AttributePath
impl Add<AttributePathStep> for AttributePath
Source§type Output = AttributePath
type Output = AttributePath
The resulting type after applying the
+ operator.Source§impl AddAssign<AttributePathStep> for AttributePath
impl AddAssign<AttributePathStep> for AttributePath
Source§fn add_assign(&mut self, rhs: AttributePathStep)
fn add_assign(&mut self, rhs: AttributePathStep)
Performs the
+= operation. Read moreSource§impl Clone for AttributePath
impl Clone for AttributePath
Source§fn clone(&self) -> AttributePath
fn clone(&self) -> AttributePath
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AttributePath
impl Debug for AttributePath
Source§impl Default for AttributePath
impl Default for AttributePath
Source§fn default() -> AttributePath
fn default() -> AttributePath
Returns the “default value” for a type. Read more
Source§impl Display for AttributePath
impl Display for AttributePath
Source§impl From<AttributePathStep> for AttributePath
impl From<AttributePathStep> for AttributePath
Source§fn from(value: AttributePathStep) -> Self
fn from(value: AttributePathStep) -> Self
Converts to this type from the input type.
Source§impl Hash for AttributePath
impl Hash for AttributePath
Source§impl PartialEq for AttributePath
impl PartialEq for AttributePath
impl Eq for AttributePath
impl StructuralPartialEq for AttributePath
Auto Trait Implementations§
impl Freeze for AttributePath
impl RefUnwindSafe for AttributePath
impl Send for AttributePath
impl Sync for AttributePath
impl Unpin for AttributePath
impl UnwindSafe for AttributePath
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request