pub struct Template { /* private fields */ }Expand description
A quoted HCL template: text, escaped when written, and expressions, interpolated as
${...}. Text can never become an interpolation, whatever it holds.
Implementations§
Source§impl Template
impl Template
Sourcepub fn with_expr(self, expr: Expression) -> Template
pub fn with_expr(self, expr: Expression) -> Template
The template with expr interpolated at its end.
Sourcepub fn push_expr(&mut self, expr: Expression)
pub fn push_expr(&mut self, expr: Expression)
Appends an interpolation of expr.
Sourcepub fn pieces(&self) -> impl Iterator<Item = Piece<'_>>
pub fn pieces(&self) -> impl Iterator<Item = Piece<'_>>
Its text and expressions, in order (for a caller that writes the template another way).
Sourcepub fn into_expression(self) -> Expression
pub fn into_expression(self) -> Expression
The template as an expression: a plain string when it has no interpolation, the
expression itself when it is one interpolation and nothing else ("${x}" is a form
Terraform deprecates for x, which it converts where a string is wanted).
Trait Implementations§
Source§impl From<Template> for Expression
impl From<Template> for Expression
Source§fn from(t: Template) -> Expression
fn from(t: Template) -> Expression
Converts to this type from the input type.
impl StructuralPartialEq for Template
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnsafeUnpin for Template
impl UnwindSafe for Template
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