Trait bracket::helper::Helper[][src]

pub trait Helper: Send + Sync {
    fn call<'render, 'call>(
        &self,
        rc: &mut Render<'render>,
        ctx: &Context<'call>,
        template: Option<&'render Node<'render>>
    ) -> HelperValue; }
Expand description

Trait for helpers.

Required methods

Function that is called when this helper is resolved by the renderer for a statement or block.

The rc argument is the render context that can be used to render inner templates and write to the destination output.

The ctx argument provides access to the helper arguments and hash parameters. It also provides support for type assertions and some convenience functions for working with the Value type.

The template argument holds the inner template when the helper is invoked as a block.

For raw block helpers use the text() function on ctx to access the underlying string slice.

Implementors