pub fn add_raw_templates(&mut self, templates: Vec<(&str, &str)>) -> Result<()> {
        for (name, content) in templates {
            let tpl = Template::new(name, None, content)
                .chain_err(|| format!("Failed to parse '{}'", name))?;
            self.templates.insert(name.to_string(), tpl);
        }
        self.build_inheritance_chains()?;
        self.check_macro_files()?;
        Ok(())
    }
/// Add all the templates given to the Tera instance
///
/// This will error if the inheritance chain can't be built, such as adding a child
/// template without the parent one.
///
/// ```rust,ignore
/// tera.add_raw_templates(vec![
///     ("new.html", "blabla"),
///     ("new2.html", "hello"),
/// ]);
/// ```
Add all the templates given to the Tera instance
This will error if the inheritance chain can't be built, such as adding a child
template without the parent one.


Add all the templates given to the Tera instance This will error if the inheritance chain can ' t be built such as adding a child template without the parent one .
pub fn add_raw_templates(&mut self, templates: Vec<(&str, &str)>) -> Result<()> {
        for (name, content) in templates {
            let tpl = Template::new(name, None, content)
                .chain_err(|| format!("Failed to parse '{}'", name))?;
            self.templates.insert(name.to_string(), tpl);
        }
        self.build_inheritance_chains()?;
        self.check_macro_files()?;
        Ok(())
    }
pub fn add_raw_templates ( & mut self , templates : Vec < ( & str , & str ) > ) -> Result < ( ) > { for ( name , content ) in templates { let tpl = Template :: new ( name , None , content ) . chain_err ( | | format ! ( " " name ) ) ? ; self . templates . insert ( name . to_string ( ) , tpl ) ; } self . build_inheritance_chains ( ) ? ; self . check_macro_files ( ) ? ; Ok ( ( ) ) }
Add all the templates given to the Tera instance
This will error if the inheritance chain can't be built, such as adding a child
template without the parent one.
Add all the templates given to the Tera instance This will error if the inheritance chain can ' t be built such as adding a child template without the parent one .
&mut self
templates
Vec<(&str, &str)>
&mut self
templates
Vec<(&str, &str)>