Crate templr Copy item path Source pub use attrs::Attribute ;
pub use attrs::Attributes ;
pub use attrs::OptAttrValue ;
pub use anyhow ;
attrs attrs This renders the attributes into a PrerenderedAttrs
struct. This can later be used for
attributes instantiation. templ The templ!
macro compiles down your template to an FnTemplate
closure.
It uses HTML like syntax to write templates, except: templ_ret Return type for functions that return templ! { ... }
.
This takes a lifetime (defaults to 'static
) and a context type (defaults to ()
). Error The Error
type, a wrapper around a dynamic error type. FnTemplate A wrapper for the render_with_children_into
closure that implements Template
. Response A response struct that implements the various frameworks’ response traits Trust Trust content and don’t escape it when interpolated in templates. Escapable Mostly like Display
, but with a DONT_ESCAPE
flag. Template Main template trait.
An implementation can be generated using the templ!
macro. TemplateExt Extension trait for generating a response ToTemplate A trait to convert a type to a Template
. Used when deriving Template
. write_escaped Writes html-escaped value
into writer
. Result Result<T, Error>
Template This derives the Template
trait using all ToTemplate
implementations.
This implementation runs ToTemplate::to_template
for every method of the Template
trait,
so that method should be very lightweight (like using templ!
).