Skip to main content

Crate cookie_cutter_core

Crate cookie_cutter_core 

Source
Expand description

= Cookie Cutter core

This is the core crate of the cookie cutter template engine.

Have a look at the main cookie_cutter crate for further information.

Modules§

builtins
Contains builtin functions and contextualizers.

Macros§

__internal__parse_include_str
Internal macro. Semver exempt. Do not use.
__internal__parse_with_path
Internal macro. Semver exempt. Do not use.
__internal__parser
Internal macro. Semver exempt. Do not use.
__internal__span_macro_include_str
Internal macro. Semver exempt. Do not use.
__internal__span_macro_with_path
Internal macro. Semver exempt. Do not use.
value
Constructs a Value using a literal syntax.

Structs§

Indentation
An amount of indentation. Typically of a template / template literal line.
Span
A span referencing a portion of template source code. Typically returned by errors to indicate the particular location of the problem.
Templates
The core struct of the templating engine. It represents fully type checked and ready to Templates::render templates.
TemplatesBuilder
The main way of obtaining Templates.

Enums§

ContextualizationError
An error that can happen when static text gets contextualized.
Error
The error type returned if building Templates failed.
ParseError
Represents a failure to parse a source file
RendertimeError
An error which can occur when attempting to render a template.
Type
The type of a cookie cutter crate::Value. Since this is used in earlier stages than the value more information is still available. For example the text type or whether it is a tuple or an array.
TypeCheckingError
An error which can occur in the type checking phase of the build process for a crate::Templates. Encountering this indicates the syntax of the source file(s) is correct since parsing errors would have ended the process early.
Value
A cookie cutter value used by the template engine to process data. Also used to provide data to templates in the form of paramters on the initial call to a render* function of a crate::Templates.

Traits§

ContextWorker
A trait to be implemented in tandem with Contextualizer by users wishing to change how static text is analysed to determine context and appropriate text type.
Contextualizer
A trait implemented by users wishing to change the way text types behave. This determines the default text type, how static text get’s analyzed and changes the context and how to escape text to safely get from one text type to another.
Escaper
A trait to be implemented in tandem with Contextualizer by users wishing to change how values are escaped to make it safe to include in a different context.
Function
A function to be used by template authors. There are several builtin ones. This can be implemented by users wishing to extend (or change) those.