pub struct TemplateLoader { /* private fields */ }Expand description
Template loader with loaded templates ready for rendering
Provides template rendering with loaded template collection. Supports hot-reload if enabled during discovery.
Implementations§
Source§impl TemplateLoader
impl TemplateLoader
Sourcepub fn get_template(&self, name: &str) -> Option<&str>
pub fn get_template(&self, name: &str) -> Option<&str>
Get template content by name
Sourcepub fn has_template(&self, name: &str) -> bool
pub fn has_template(&self, name: &str) -> bool
Check if template exists
Sourcepub fn template_names(&self) -> Vec<&str>
pub fn template_names(&self) -> Vec<&str>
List all available template names
Sourcepub fn templates_by_category(&self) -> HashMap<String, Vec<String>>
pub fn templates_by_category(&self) -> HashMap<String, Vec<String>>
List templates by category (for hierarchical organization)
Sourcepub fn create_renderer(
&self,
context: TemplateContext,
) -> Result<TemplateRenderer>
pub fn create_renderer( &self, context: TemplateContext, ) -> Result<TemplateRenderer>
Create template renderer with loaded templates
§Arguments
context- Template context for renderingdeterminism- Optional determinism configuration
Sourcepub fn render(&self, name: &str, context: TemplateContext) -> Result<String>
pub fn render(&self, name: &str, context: TemplateContext) -> Result<String>
Render template by name
§Arguments
name- Template namecontext- Template contextdeterminism- Optional determinism configuration
Trait Implementations§
Source§impl Debug for TemplateLoader
impl Debug for TemplateLoader
Auto Trait Implementations§
impl Freeze for TemplateLoader
impl RefUnwindSafe for TemplateLoader
impl Send for TemplateLoader
impl Sync for TemplateLoader
impl Unpin for TemplateLoader
impl UnwindSafe for TemplateLoader
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