pub fn register_template_file<P>(
        &mut self,
        name: &str,
        tpl_path: P,
    ) -> Result<(), TemplateError>
    where
        P: AsRef<Path>,
    {
        let source = FileSource::new(tpl_path.as_ref().into());
        let template_string = source
            .load()
            .map_err(|err| TemplateError::from((err, name.to_owned())))?;

        self.register_template_string(name, template_string)?;
        if self.dev_mode {
            self.template_sources
                .insert(name.to_owned(), Arc::new(source));
        }

        Ok(())
    }
/// Register a template from a path on file system
///
/// If dev mode is enabled, the registry will keep reading the template file
/// from file system everytime it's visited.
Register a template from a path on file system
If dev mode is enabled, the registry will keep reading the template file
from file system everytime it's visited.
Register a template from a path on file system If dev mode is enabled the registry will keep reading the template file from file system everytime it ' s visited .
pub fn register_template_file<P>(
        &mut self,
        name: &str,
        tpl_path: P,
    ) -> Result<(), TemplateError>
    where
        P: AsRef<Path>,
    {
        let source = FileSource::new(tpl_path.as_ref().into());
        let template_string = source
            .load()
            .map_err(|err| TemplateError::from((err, name.to_owned())))?;
        self.register_template_string(name, template_string)?;
        if self.dev_mode {
            self.template_sources
                .insert(name.to_owned(), Arc::new(source));
        }
        Ok(())
    }
pub fn register_template_file < P > ( & mut self , name : & str , tpl_path : P , ) -> Result < ( ) , TemplateError > where P : AsRef < Path > , { let source = FileSource :: new ( tpl_path . as_ref ( ) . into ( ) ) ; let template_string = source . load ( ) . map_err ( | err | TemplateError :: from ( ( err , name . to_owned ( ) ) ) ) ? ; self . register_template_string ( name , template_string ) ? ; if self . dev_mode { self . template_sources . insert ( name . to_owned ( ) , Arc :: new ( source ) ) ; } Ok ( ( ) ) }
Register a template from a path on file system
If dev mode is enabled, the registry will keep reading the template file
from file system everytime it's visited.
Register a template from a path on file system If dev mode is enabled the registry will keep reading the template file from file system everytime it ' s visited .
&mut self
name
&str
tpl_path
P
&mut self
name
&str
tpl_path
P