pub struct IfTemplateExpr {
pub cond_expr: Expression,
pub template: Template,
pub strip: Strip,
/* private fields */
}
Expand description
A type representing the %{ if cond_expr }
sub-expression and the template that follows after
it within an IfDirective
.
Fields§
§cond_expr: Expression
The condition expression.
template: Template
The template that is included in the result string if the conditional expression evaluates
to true
.
strip: Strip
The whitespace strip behaviour to use on the template elements preceeding and following
after the if
expression.
Implementations§
Source§impl IfTemplateExpr
impl IfTemplateExpr
Sourcepub fn new(
cond_expr: impl Into<Expression>,
template: Template,
) -> IfTemplateExpr
pub fn new( cond_expr: impl Into<Expression>, template: Template, ) -> IfTemplateExpr
Creates a new IfTemplateExpr
for a condition expression and a template.
Sourcepub fn preamble(&self) -> &RawString
pub fn preamble(&self) -> &RawString
Return a reference to the raw leading decor after the if
’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 if
’s opening {
.
Trait Implementations§
Source§impl Clone for IfTemplateExpr
impl Clone for IfTemplateExpr
Source§fn clone(&self) -> IfTemplateExpr
fn clone(&self) -> IfTemplateExpr
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 IfTemplateExpr
impl Debug for IfTemplateExpr
Source§impl PartialEq for IfTemplateExpr
impl PartialEq for IfTemplateExpr
impl Eq for IfTemplateExpr
impl StructuralPartialEq for IfTemplateExpr
Auto Trait Implementations§
impl Freeze for IfTemplateExpr
impl RefUnwindSafe for IfTemplateExpr
impl Send for IfTemplateExpr
impl Sync for IfTemplateExpr
impl Unpin for IfTemplateExpr
impl UnwindSafe for IfTemplateExpr
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