pub struct IfNode {
pub span: Span,
pub branches: Vec<(TokenStream, Template)>,
pub else_body: Option<Box<Template>>,
}Expand description
An @if / @else if / @else conditional block.
@if (condition) {
// then branch
} @else if (other) {
// else-if branch
} @else {
// else branch
}Fields§
§span: SpanSource span of the @ token.
branches: Vec<(TokenStream, Template)>One or more (condition, body) pairs. The first is the @if branch;
subsequent pairs are @else if branches.
else_body: Option<Box<Template>>Body of the trailing @else block, if present.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IfNode
impl RefUnwindSafe for IfNode
impl !Send for IfNode
impl !Sync for IfNode
impl Unpin for IfNode
impl UnsafeUnpin for IfNode
impl UnwindSafe for IfNode
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