pub enum Node {
Text(String),
Echo {
expr: Expr,
escaped: bool,
},
If {
branches: Vec<Branch>,
otherwise: Option<Vec<Node>>,
},
Foreach {
subject: Expr,
binding: String,
body: Vec<Node>,
},
Yield {
section: String,
default: Option<Expr>,
},
Include(TemplateRef),
}Expand description
One renderable piece of a template.
Variants§
Text(String)
Literal markup.
Echo
{{ expr }} when escaped, {!! expr !!} when not.
If
@if / @elseif / @else: the first branch whose condition is truthy
wins, otherwise otherwise runs if there is one.
Foreach
@foreach(subject as binding).
Yield
@yield("name"), with the optional fallback from @yield("name", expr).
Include(TemplateRef)
@include("partial").
Trait Implementations§
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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