pub struct Template {
pub name: String,
pub nodes: Vec<Node>,
pub extends: Option<TemplateRef>,
pub sections: BTreeMap<String, Vec<Node>>,
}Expand description
A parsed template: what it renders, plus the layout wiring around it.
Fields§
§name: StringThe view name it was loaded under, e.g. pages.home.
nodes: Vec<Node>Everything outside a @section.
extends: Option<TemplateRef>The layout named by @extends, if any.
sections: BTreeMap<String, Vec<Node>>Section bodies, keyed by name and hoisted out of nodes.
Sections are captured rather than rendered in place: they exist to be
pulled into a layout by @yield, so a template that defines one and is
rendered on its own simply does not emit it.
Trait Implementations§
impl StructuralPartialEq for Template
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnsafeUnpin for Template
impl UnwindSafe for Template
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