Struct hcl::expr::TraversalBuilder

source ·
pub struct TraversalBuilder { /* private fields */ }
Expand description

A builder for expression traversals.

It is constructed via the builder method of the Traversal type.

Example

use hcl::expr::{Traversal, Variable};

let traversal = Traversal::builder(Variable::new("var")?)
    .attr("some_array")
    .index(0)
    .build();

// Serializes as `var.some_array[0]`.

Implementations§

Add an attribute access operator to the traversal chain.

Add an attribute splat operator to the traversal chain.

Add a full splat operator to the traversal chain.

Add an index operator to the traversal chain.

Consume self and return a Traversal.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.