Struct hcl_edit::template::ElseTemplateExpr
source · pub struct ElseTemplateExpr {
pub template: Template,
pub strip: Strip,
/* private fields */
}Expand description
A type representing the %{ else } sub-expression and the template that follows after it
within an IfDirective.
Fields§
§template: TemplateThe template that is included in the result string if the if branch’s conditional
expression evaluates to false.
strip: StripThe whitespace strip behaviour to use on the template elements preceeding and following
after the else expression.
Implementations§
source§impl ElseTemplateExpr
impl ElseTemplateExpr
sourcepub fn new(template: Template) -> ElseTemplateExpr
pub fn new(template: Template) -> ElseTemplateExpr
Creates a new ElseTemplateExpr for a template.
sourcepub fn preamble(&self) -> &RawString
pub fn preamble(&self) -> &RawString
Return a reference to the raw leading decor after the else’s opening {.
sourcepub fn set_preamble(&mut self, preamble: impl Into<RawString>)
pub fn set_preamble(&mut self, preamble: impl Into<RawString>)
Set the raw leading decor after the else’s opening {.
sourcepub fn trailing(&self) -> &RawString
pub fn trailing(&self) -> &RawString
Return a reference to the raw trailing decor before the else’s closing }.
sourcepub fn set_trailing(&mut self, trailing: impl Into<RawString>)
pub fn set_trailing(&mut self, trailing: impl Into<RawString>)
Set the raw trailing decor before the else’s closing }.
Trait Implementations§
source§impl Clone for ElseTemplateExpr
impl Clone for ElseTemplateExpr
source§fn clone(&self) -> ElseTemplateExpr
fn clone(&self) -> ElseTemplateExpr
Returns a copy 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 ElseTemplateExpr
impl Debug for ElseTemplateExpr
source§impl PartialEq for ElseTemplateExpr
impl PartialEq for ElseTemplateExpr
source§fn eq(&self, other: &ElseTemplateExpr) -> bool
fn eq(&self, other: &ElseTemplateExpr) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for ElseTemplateExpr
impl StructuralPartialEq for ElseTemplateExpr
Auto Trait Implementations§
impl Freeze for ElseTemplateExpr
impl RefUnwindSafe for ElseTemplateExpr
impl Send for ElseTemplateExpr
impl Sync for ElseTemplateExpr
impl Unpin for ElseTemplateExpr
impl UnwindSafe for ElseTemplateExpr
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