pub fn render_template_with_context(
        &self,
        template_string: &str,
        ctx: &Context,
    ) -> Result<String, RenderError> {
        let tpl = Template::compile2(
            template_string,
            TemplateOptions {
                prevent_indent: self.prevent_indent,
                ..Default::default()
            },
        )?;

        let mut out = StringOutput::new();
        {
            let mut render_context = RenderContext::new(None);
            tpl.render(self, ctx, &mut render_context, &mut out)?;
        }

        out.into_string().map_err(RenderError::from)
    }
/// Render a template string using reused context data
Render a template string using reused context data
Render a template string using reused context data
pub fn render_template_with_context(
        &self,
        template_string: &str,
        ctx: &Context,
    ) -> Result<String, RenderError> {
        let tpl = Template::compile2(
            template_string,
            TemplateOptions {
                prevent_indent: self.prevent_indent,
                ..Default::default()
            },
        )?;
        let mut out = StringOutput::new();
        {
            let mut render_context = RenderContext::new(None);
            tpl.render(self, ctx, &mut render_context, &mut out)?;
        }
        out.into_string().map_err(RenderError::from)
    }
pub fn render_template_with_context ( & self , template_string : & str , ctx : & Context , ) -> Result < String , RenderError > { let tpl = Template :: compile2 ( template_string , TemplateOptions { prevent_indent : self . prevent_indent , .. Default :: default ( ) } , ) ? ; let mut out = StringOutput :: new ( ) ; { let mut render_context = RenderContext :: new ( None ) ; tpl . render ( self , ctx , & mut render_context , & mut out ) ? ; } out . into_string ( ) . map_err ( RenderError :: from ) }
Render a template string using reused context data
Render a template string using reused context data
&self
template_string
&str
ctx
&Context
&self
template_string
&str
ctx
&Context