pub fn register_template_string<S>(
        &mut self,
        name: &str,
        tpl_str: S,
    ) -> Result<(), TemplateError>
    where
        S: AsRef<str>,
    {
        let template = Template::compile2(
            tpl_str.as_ref(),
            TemplateOptions {
                name: Some(name.to_owned()),
                prevent_indent: self.prevent_indent,
            },
        )?;
        self.register_template(name, template);
        Ok(())
    }
/// Register a template string
///
/// Returns `TemplateError` if there is syntax error on parsing the template.
Register a template string
Returns `TemplateError` if there is syntax error on parsing the template.
Register a template string Returns ` TemplateError ` if there is syntax error on parsing the template .
pub fn register_template_string<S>(
        &mut self,
        name: &str,
        tpl_str: S,
    ) -> Result<(), TemplateError>
    where
        S: AsRef<str>,
    {
        let template = Template::compile2(
            tpl_str.as_ref(),
            TemplateOptions {
                name: Some(name.to_owned()),
                prevent_indent: self.prevent_indent,
            },
        )?;
        self.register_template(name, template);
        Ok(())
    }
pub fn register_template_string < S > ( & mut self , name : & str , tpl_str : S , ) -> Result < ( ) , TemplateError > where S : AsRef < str > , { let template = Template :: compile2 ( tpl_str . as_ref ( ) , TemplateOptions { name : Some ( name . to_owned ( ) ) , prevent_indent : self . prevent_indent , } , ) ? ; self . register_template ( name , template ) ; Ok ( ( ) ) }
Register a template string
Returns `TemplateError` if there is syntax error on parsing the template.
Register a template string Returns ` TemplateError ` if there is syntax error on parsing the template .
&mut self
name
&str
tpl_str
S
&mut self
name
&str
tpl_str
S