pub fn render<T: Serialize>(&self, template_name: &str, data: &T) -> Result<String> {
        let value = to_value(data)?;
        if !value.is_object() {
            bail!(
                "Failed to render '{}': context isn't a JSON object. \
                The value passed needs to be a key-value object: context, struct, hashmap for example.",
                template_name
            );
        }

        let template = self.get_template(template_name)?;
        let renderer = Renderer::new(template, self, value);
        renderer.render()
    }
/// Renders a Tera template given an object that implements `Serialize`.
///
/// To render a template with an empty context, simply pass a new `Context` object
///
/// If `data` is serializing to an object, an error will be returned.
///
/// ```rust,ignore
/// // Rendering a template with a normal context
/// let mut context = Context::new();
/// context.insert("age", 18);
/// tera.render("hello.html", &context);
/// // Rendering a template with a struct that impl `Serialize`
/// tera.render("hello.html", &product);
/// // Rendering a template with an empty context
/// tera.render("hello.html", &Context::new());
/// ```
Renders a Tera template given an object that implements `Serialize`.
To render a template with an empty context, simply pass a new `Context` object

If `data` is serializing to an object, an error will be returned.


Renders a Tera template given an object that implements ` Serialize ` . To render a template with an empty context simply pass a new ` Context ` object If ` data ` is serializing to an object an error will be returned .
pub fn render<T: Serialize>(&self, template_name: &str, data: &T) -> Result<String> {
        let value = to_value(data)?;
        if !value.is_object() {
            bail!(
                "Failed to render '{}': context isn't a JSON object. \
                The value passed needs to be a key-value object: context, struct, hashmap for example.",
                template_name
            );
        }
        let template = self.get_template(template_name)?;
        let renderer = Renderer::new(template, self, value);
        renderer.render()
    }
pub fn render < T : Serialize > ( & self , template_name : & str , data : & T ) -> Result < String > { let value = to_value ( data ) ? ; if ! value . is_object ( ) { bail ! ( " \
 " template_name ) ; } let template = self . get_template ( template_name ) ? ; let renderer = Renderer :: new ( template , self , value ) ; renderer . render ( ) }
Renders a Tera template given an object that implements `Serialize`.
Renders a Tera template given an object that implements ` Serialize ` .
&self
template_name
&str
data
&T
&self
template_name
&str
data
&T