pub struct Traversal {
pub expr: Expression,
pub operators: Vec<TraversalOperator>,
}
Expand description
Traverse an expression to access attributes, object keys or element indices.
Fields§
§expr: Expression
The expression that the access operator is applied to.
operators: Vec<TraversalOperator>
The traversal operators to apply to expr
one of the other.
Implementations§
Source§impl Traversal
impl Traversal
Sourcepub fn new<E, I>(expr: E, operators: I) -> Self
pub fn new<E, I>(expr: E, operators: I) -> Self
Creates a new Traversal
structure from an expression and traversal operators that should
be applied to it.
Sourcepub fn builder<T>(expr: T) -> TraversalBuilderwhere
T: Into<Expression>,
pub fn builder<T>(expr: T) -> TraversalBuilderwhere
T: Into<Expression>,
Create a new TraversalBuilder
for the given expression.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Traversal
impl<'de> Deserialize<'de> for Traversal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Evaluate for Traversal
impl Evaluate for Traversal
Source§fn evaluate(&self, ctx: &Context<'_>) -> EvalResult<Self::Output>
fn evaluate(&self, ctx: &Context<'_>) -> EvalResult<Self::Output>
Recursively evaluates all HCL templates and expressions in the implementing type using the
variables and functions declared in the
Context
. Read moreSource§fn evaluate_in_place(&mut self, ctx: &Context<'_>) -> EvalResult<(), Errors>
fn evaluate_in_place(&mut self, ctx: &Context<'_>) -> EvalResult<(), Errors>
Recursively tries to evaluate all nested expressions in place. Read more
Source§impl Format for Traversal
impl Format for Traversal
Source§fn format<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<()>where
W: Write,
fn format<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<()>where
W: Write,
Formats a HCL structure using a formatter and writes the result to the provided writer. Read more
Source§impl From<Traversal> for Expression
impl From<Traversal> for Expression
Source§impl<'de> IntoDeserializer<'de, Error> for Traversal
impl<'de> IntoDeserializer<'de, Error> for Traversal
Source§type Deserializer = MapAccessDeserializer<TraversalAccess>
type Deserializer = MapAccessDeserializer<TraversalAccess>
The type of the deserializer being converted into.
Source§fn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
impl Eq for Traversal
impl StructuralPartialEq for Traversal
Auto Trait Implementations§
impl Freeze for Traversal
impl RefUnwindSafe for Traversal
impl Send for Traversal
impl Sync for Traversal
impl Unpin for Traversal
impl UnwindSafe for Traversal
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§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.