Crate templr

source ·

Re-exports

Macros

  • The templ macro compiles down your template to rust. It uses HTML like syntax to write templates, except:

Structs

  • The Error type, a wrapper around a dynamic error type.
  • A wrapper for the render_into function that implements Template.
  • Trust content and don’t escape it when interpolated in templates.

Traits

  • The attribute trait, this will write a single attribute.
  • The attributes trait, this can write a variable amount of attributes. You can use this within a template using a braced attribute, {...}.
  • Mostly like std::fmt::Display, but with a DONT_ESCAPE flag.
  • The trait for optional attribute values. This is used when attr?={value} is evaluated.
  • Main template trait. An implementation can be generated using both the templ! macro.
  • A trait to convert a type to a template. Used when instantiating templates.

Functions

Type Aliases