pub enum Node {
Text(String),
Echo {
expr: Expr,
raw: bool,
},
If {
branches: Vec<(Condition, Vec<Node>)>,
otherwise: Option<Vec<Node>>,
},
Foreach {
collection: Expr,
key: Option<String>,
value: String,
body: Vec<Node>,
},
Include(String),
Yield(String),
Section {
name: String,
body: Vec<Node>,
},
}Expand description
One piece of a template.
Variants§
Text(String)
Literal text.
Echo
{{ expr }} (escaped) or {!! expr !!} (raw).
If
@if … @elseif … @else … @endif.
Fields
Foreach
@foreach(items as item) … @endforeach.
Fields
Include(String)
@include('partial').
Yield(String)
@yield('name') — where a layout drops a child’s section.
Section
@section('name') … @endsection.
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