pub struct CachedRenderer { /* private fields */ }Expand description
Cached template renderer with hot-reload support
Combines TemplateRenderer with TemplateCache for optimal performance and development experience.
Implementations§
Source§impl CachedRenderer
impl CachedRenderer
Sourcepub fn new(context: TemplateContext, hot_reload: bool) -> Result<Self>
pub fn new(context: TemplateContext, hot_reload: bool) -> Result<Self>
Sourcepub fn render_cached(
&mut self,
template: &str,
name: &str,
file_path: Option<&Path>,
) -> Result<String>
pub fn render_cached( &mut self, template: &str, name: &str, file_path: Option<&Path>, ) -> Result<String>
Render template with caching
§Arguments
template- Template contentname- Template name for cachingfile_path- Optional file path for hot-reload
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 template cache
Sourcepub fn evict_expired(&self) -> usize
pub fn evict_expired(&self) -> usize
Evict expired templates from cache
Sourcepub fn renderer(&self) -> &TemplateRenderer
pub fn renderer(&self) -> &TemplateRenderer
Access the underlying template renderer
Sourcepub fn renderer_mut(&mut self) -> &mut TemplateRenderer
pub fn renderer_mut(&mut self) -> &mut TemplateRenderer
Access the underlying template renderer mutably
Auto Trait Implementations§
impl Freeze for CachedRenderer
impl !RefUnwindSafe for CachedRenderer
impl Send for CachedRenderer
impl Sync for CachedRenderer
impl Unpin for CachedRenderer
impl !UnwindSafe for CachedRenderer
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