pub struct ShellTemplate { /* private fields */ }Expand description
A compiled shell template.
Compiling is separate from rendering so a bad template is reported once, against the file it came from, rather than once per page.
Implementations§
Source§impl ShellTemplate
impl ShellTemplate
Sourcepub fn parse(source: &str) -> Result<Self, ShellError>
pub fn parse(source: &str) -> Result<Self, ShellError>
Compile a template, rejecting unknown slot names and slots written with the wrong braces for their kind.
Sourcepub fn render(&self, slots: &ShellSlots) -> String
pub fn render(&self, slots: &ShellSlots) -> String
Fill the template’s slots.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShellTemplate
impl RefUnwindSafe for ShellTemplate
impl Send for ShellTemplate
impl Sync for ShellTemplate
impl Unpin for ShellTemplate
impl UnsafeUnpin for ShellTemplate
impl UnwindSafe for ShellTemplate
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