pub struct TemplateCache { /* private fields */ }
Expand description
Template cache for compiled templates
Implementations§
Source§impl TemplateCache
impl TemplateCache
Sourcepub async fn cache_template(
&self,
key: String,
template: String,
variables: Vec<String>,
)
pub async fn cache_template( &self, key: String, template: String, variables: Vec<String>, )
Cache a compiled template
Sourcepub async fn get_template(&self, key: &str) -> Option<CompiledTemplate>
pub async fn get_template(&self, key: &str) -> Option<CompiledTemplate>
Get cached template
Sourcepub async fn stats(&self) -> CacheStats
pub async fn stats(&self) -> CacheStats
Get cache statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TemplateCache
impl !RefUnwindSafe for TemplateCache
impl Send for TemplateCache
impl Sync for TemplateCache
impl Unpin for TemplateCache
impl !UnwindSafe for TemplateCache
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