Struct mage::Cache
[−]
[src]
pub struct Cache { /* fields omitted */ }
Compiled template cache
Examples
use mage::Cache; let mut cache = Cache::new(); cache.load("examples", "html"); let template = cache.get("main").unwrap(); let output = template.render().unwrap();
Methods
impl Cache
[src]
fn new() -> Cache
Create a cache.
fn load<P, T>(&mut self, root: P, extension: T) where
P: AsRef<Path>,
T: AsRef<str>,
P: AsRef<Path>,
T: AsRef<str>,
Load templates with the given root and extension.
fn get(&self, view: &str) -> Option<&Template>
Find cached template.