fn call<'reg: 'rc, 'rc>(
        &self,
        h: &Helper<'reg, 'rc>,
        r: &'reg Registry<'reg>,
        ctx: &'rc Context,
        rc: &mut RenderContext<'reg, 'rc>,
        out: &mut dyn Output,
    ) -> HelperResult {
        match self.call_inner(h, r, ctx, rc) {
            Ok(result) => {
                if r.strict_mode() && result.is_missing() {
                    Err(RenderError::strict_error(None))
                } else {
                    // auto escape according to settings
                    let output = do_escape(r, rc, result.render());
                    out.write(output.as_ref())?;
                    Ok(())
                }
            }
            Err(e) => {
                if e.is_unimplemented() {
                    // default implementation, do nothing
                    Ok(())
                } else {
                    Err(e)
                }
            }
        }
    }
/// A complex version of helper interface.
///
/// This function offers `Output`, which you can write custom string into
/// and render child template. Helpers like `if` and `each` are implemented
/// with this. Because the data written into `Output` are typically without
/// type information. So helpers defined by this function are not composable.
///
/// ### Calling from subexpression
///
/// Although helpers defined by this are not composable, when called from
/// subexpression, handlebars tries to parse the string output as JSON to
/// re-build its type. This can be buggy with numrical and other literal values.
/// So it is not recommended to use these helpers in subexpression.
A complex version of helper interface.
This function offers `Output`, which you can write custom string into
and render child template. Helpers like `if` and `each` are implemented
with this. Because the data written into `Output` are typically without
type information. So helpers defined by this function are not composable.
A complex version of helper interface . This function offers ` Output ` which you can write custom string into and render child template . Helpers like ` if ` and ` each ` are implemented with this . Because the data written into ` Output ` are typically without type information . So helpers defined by this function are not composable .
fn call<'reg: 'rc, 'rc>(
        &self,
        h: &Helper<'reg, 'rc>,
        r: &'reg Registry<'reg>,
        ctx: &'rc Context,
        rc: &mut RenderContext<'reg, 'rc>,
        out: &mut dyn Output,
    ) -> HelperResult {
        match self.call_inner(h, r, ctx, rc) {
            Ok(result) => {
                if r.strict_mode() && result.is_missing() {
                    Err(RenderError::strict_error(None))
                } else {
                    // auto escape according to settings
                    let output = do_escape(r, rc, result.render());
                    out.write(output.as_ref())?;
                    Ok(())
                }
            }
            Err(e) => {
                if e.is_unimplemented() {
                    // default implementation, do nothing
                    Ok(())
                } else {
                    Err(e)
                }
            }
        }
    }
fn call < ' reg : ' rc , ' rc > ( & self , h : & Helper < ' reg , ' rc > , r : & ' reg Registry < ' reg > , ctx : & ' rc Context , rc : & mut RenderContext < ' reg , ' rc > , out : & mut dyn Output , ) -> HelperResult { match self . call_inner ( h , r , ctx , rc ) { Ok ( result ) => { if r . strict_mode ( ) && result . is_missing ( ) { Err ( RenderError :: strict_error ( None ) ) } else { // auto escape according to settings let output = do_escape ( r , rc , result . render ( ) ) ; out . write ( output . as_ref ( ) ) ? ; Ok ( ( ) ) } } Err ( e ) => { if e . is_unimplemented ( ) { // default implementation, do nothing Ok ( ( ) ) } else { Err ( e ) } } } }
A complex version of helper interface.
A complex version of helper interface .
&self
h
&Helper<'reg, 'rc>
r
&'reg Registry<'reg>
ctx
&'rc Context
rc
&mut RenderContext<'reg, 'rc>
out
&mut dyn Output
&self
h
&Helper<'reg, 'rc>
r
&'reg Registry<'reg>
ctx
&'rc Context
rc
&mut RenderContext<'reg, 'rc>
out
&mut dyn Output
calling from subexpression
Although helpers defined by this are not composable, when called from
subexpression, handlebars tries to parse the string output as JSON to
re-build its type. This can be buggy with numrical and other literal values.
So it is not recommended to use these helpers in subexpression.
Although helpers defined by this are not composable when called from subexpression handlebars tries to parse the string output as JSON to re - build its type . This can be buggy with numrical and other literal values . So it is not recommended to use these helpers in subexpression .