Crate templatia_derive

Crate templatia_derive 

Source
Expand description

§Templatia Derive

Procedural macros for the templatia template parsing library.

This crate provides the #[derive(Template)] macro that automatically generates templatia::Template trait implementations for named structs.

§Limitations

  • Named Structs Only: Currently only struct Name { field: Type } is supported
  • No Tuple Structs: struct Point(i32, i32) is not supported yet
  • No Enums: Enum support is planned for future versions
  • Field Requirements: Template fields must implement Display, FromStr, and PartialEq

§Attribute Reference

§#[templatia(template = "...")]

Defines a custom template string with {field_name} placeholders.

Rules:

  • Placeholders must match struct field names exactly
  • All placeholders must reference existing fields
  • Duplicate placeholders are allowed but must have consistent values during parsing

For detailed usage examples and comprehensive documentation, see the main templatia crate.

Derive Macros§

Template
Derive macro for implementing templatia::Template trait on named structs.