|0.5.6||Nov 3, 2023|
|0.5.4||Nov 3, 2022|
|0.5.3||May 10, 2022|
|0.5.2||Mar 19, 2022|
|0.4.3||Jul 26, 2019|
#1974 in Web programming
335 downloads per month
Used in 4 crates
Include Tera Templates for Rocket Framework
This is a crate which provides macros
tera_response! to statically include Tera files from your Rust project and make them be the HTTP response sources quickly.
tera_resources_initialize!is used in the fairing of
TeraResponseFairingto include Tera files into your executable binary file. You need to specify each file's name and its path relative to the directory containing the manifest of your package. In order to reduce the compilation time and allow to hot-reload templates, files are compiled into your executable binary file together, only when you are using the release profile.
tera_response!is used for retrieving and rendering the file you input through the macro
TeraResponseinstance with rendered HTML. When its
respond_tomethod is called, three HTTP headers, Content-Type, Content-Length and Etag, will be automatically added, and the rendered HTML can optionally not be minified.
tera_response_cache!is used for wrapping a
TeraResponseand its constructor, and use a key to cache its HTML and ETag in memory. The cache is generated only when you are using the release profile.
tera_resources_initializer!is used for generating a fairing for tera resources.