Struct hcl::template::Interpolation
source · [−]pub struct Interpolation {
pub expr: Expression,
pub strip: StripMode,
}
Expand description
An interpolation sequence evaluates an expression (written in the expression sub-language), converts the result to a string value, and replaces itself with the resulting string.
Fields
expr: Expression
The interpolated expression.
strip: StripMode
The whitespace strip mode to use on the template elements preceeding and following after this interpolation sequence.
Implementations
sourceimpl Interpolation
impl Interpolation
sourcepub fn new<T>(expr: T) -> Interpolationwhere
T: Into<Expression>,
pub fn new<T>(expr: T) -> Interpolationwhere
T: Into<Expression>,
Creates a new expression Interpolation
.
sourcepub fn with_strip(self, strip: StripMode) -> Interpolation
pub fn with_strip(self, strip: StripMode) -> Interpolation
Sets the whitespace strip mode to use on the template elements preceeding and following
after this interpolation sequence and returns the modified Interpolation
.
Trait Implementations
sourceimpl Clone for Interpolation
impl Clone for Interpolation
sourcefn clone(&self) -> Interpolation
fn clone(&self) -> Interpolation
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Interpolation
impl Debug for Interpolation
sourceimpl From<Expression> for Interpolation
impl From<Expression> for Interpolation
sourcefn from(expr: Expression) -> Self
fn from(expr: Expression) -> Self
Converts to this type from the input type.
sourceimpl From<Interpolation> for Element
impl From<Interpolation> for Element
sourcefn from(interpolation: Interpolation) -> Self
fn from(interpolation: Interpolation) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<Interpolation> for Interpolation
impl PartialEq<Interpolation> for Interpolation
sourcefn eq(&self, other: &Interpolation) -> bool
fn eq(&self, other: &Interpolation) -> bool
impl Eq for Interpolation
impl StructuralEq for Interpolation
impl StructuralPartialEq for Interpolation
Auto Trait Implementations
impl RefUnwindSafe for Interpolation
impl Send for Interpolation
impl Sync for Interpolation
impl Unpin for Interpolation
impl UnwindSafe for Interpolation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.