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: Template
The template that is included in the result string if the if
branch’s conditional
expression evaluates to false
.
strip: Strip
The 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
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