Struct chilli::Handlebars [] [src]

pub struct Handlebars { /* fields omitted */ }

The single entry point of your Handlebars templates

It maintains compiled templates and registered helpers.

Methods

impl Registry
[src]

[src]

[src]

Enable handlebars template source map

Source map provides line/col reporting on error. It uses slightly more memory to maintain the data.

Default is true.

[src]

Register a template string

Returns TemplateError if there is syntax error on parsing template.

[src]

Register a partial string

A named partial will be added to the registry. It will overwrite template with same name. Currently registered partial is just identical to template.

[src]

Register a template from a path

[src]

Register a template from std::io::Read source

[src]

remove a template from the registry

[src]

register a helper

[src]

register a decorator

[src]

Register a new escape fn to be used from now on by this registry.

[src]

Restore the default escape fn.

[src]

Get a reference to the current escape fn.

[src]

Return a registered template,

[src]

Return a registered helper

[src]

Return a registered directive, aka decorator

[src]

Return all templates registered

[src]

Unregister all templates

[src]

Render a registered template with some data into a string

  • name is the template name you registred previously
  • ctx is the data that implements ToJson of either rustc_serialize or serde_json

Returns rendered string or an struct with error information

[src]

Render a registered template and write some data to the std::io::Write

[src]

render a template string using current registry without register it

[src]

render a template string using current registry without register it

[src]

render a template source using current registry without register it

Trait Implementations

Auto Trait Implementations

impl Send for Registry

impl Sync for Registry