Struct bracket::registry::Registry[][src]

pub struct Registry<'reg> { /* fields omitted */ }
Expand description

Registry is the entry point for compiling and rendering templates.

A template name is always required for error messages.

Implementations

Create an empty registry.

Set the strict mode.

Get the strict mode.

Set the escape function for rendering.

The escape function to use for rendering.

Helper registry.

Mutable reference to the helper registry.

Event handler registry.

Mutable reference to the event handler registry.

Templates collection.

Mutable reference to the templates.

👎 Deprecated since 0.9.29:

Use get() instead.

Get a named template.

Get a named template.

Remove a named template.

Insert a named string template.

Add a named template from a file.

Requires the fs feature.

Load a file and use the file path as the template name.

Requires the fs feature.

Load all the files in a target directory that match the given extension.

The generated name is the file stem; ie, the name of the file once the extension has been removed.

Requires the fs feature.

Compile a string to a template.

To compile a template and add it to this registry use insert(), add(), load() or read_dir().

Compile a string to a template using the given name.

This is a convenience function for calling compile() using parser options with the given name.

Lint a template.

Render a template without registering it and return the result as a string.

This function buffers the template nodes before rendering.

Render a named template and buffer the result to a string.

The named template must exist in the templates collection.

Render a compiled template without registering it and buffer the result to a string.

Render a named template to a writer.

The named template must exist in the templates collection.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.