pub struct TemplateEngine {
pub loader: TemplateLoader,
pub context: TemplateContext,
pub validator: TemplateValidator,
pub function_registry: FunctionRegistry,
pub toml_loader: TomlLoader,
pub toml_writer: TomlWriter,
pub toml_merger: TomlMerger,
pub cache: CachedRenderer,
pub output_format: OutputFormat,
pub debug_enabled: bool,
}Expand description
Complete template engine with all configured components
Provides access to all template engine components for advanced usage scenarios
Fields§
§loader: TemplateLoaderTemplate loader for template discovery and loading
context: TemplateContextTemplate context for variable resolution
validator: TemplateValidatorTemplate validator for output validation
function_registry: FunctionRegistryCustom function registry
toml_loader: TomlLoaderTOML file loader
toml_writer: TomlWriterTOML file writer
toml_merger: TomlMergerTOML merger for combining files
cache: CachedRendererCached renderer for performance
output_format: OutputFormatDefault output format
debug_enabled: boolDebug mode enabled
Implementations§
Source§impl TemplateEngine
impl TemplateEngine
Sourcepub fn render_with_context(
&mut self,
name: &str,
context: TemplateContext,
) -> Result<String>
pub fn render_with_context( &mut self, name: &str, context: TemplateContext, ) -> Result<String>
Render template with custom context
§Arguments
name- Template namecontext- Custom context for rendering
Sourcepub fn render_to_format(
&mut self,
name: &str,
format: OutputFormat,
) -> Result<String>
pub fn render_to_format( &mut self, name: &str, format: OutputFormat, ) -> Result<String>
Sourcepub fn validate_template(&self, name: &str) -> Result<()>
pub fn validate_template(&self, name: &str) -> Result<()>
Sourcepub fn cache_stats(&self) -> CacheStats
pub fn cache_stats(&self) -> CacheStats
Get cache statistics
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear cache
Auto Trait Implementations§
impl Freeze for TemplateEngine
impl !RefUnwindSafe for TemplateEngine
impl Send for TemplateEngine
impl Sync for TemplateEngine
impl Unpin for TemplateEngine
impl !UnwindSafe for TemplateEngine
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