standout-macros 3.7.0

Proc macros for compile-time resource embedding in Standout
Documentation

Proc macros for Standout.

This crate provides macros for compile-time resource embedding and declarative command dispatch configuration.

Available Macros

Embedding Macros

  • [embed_templates!] - Embed template files (.jinja, .jinja2, .j2, .txt)
  • [embed_styles!] - Embed stylesheet files (.yaml, .yml)

Derive Macros

  • [Dispatch] - Generate dispatch configuration from clap Subcommand enums
  • [Tabular] - Generate TabularSpec from struct field annotations
  • [TabularRow] - Generate optimized row extraction without JSON serialization
  • [Seekable] - Generate query-enabled accessor functions for Seeker

Attribute Macros

  • [handler] - Transform pure functions into Standout-compatible handlers

Design Philosophy

These macros return EmbeddedSource types that contain:

  1. Embedded content (baked into binary at compile time)
  2. Source path (for debug hot-reload)

This design enables:

  • Release builds: Use embedded content, zero file I/O
  • Debug builds: Hot-reload from disk if source path exists

Examples

For working examples, see:

  • standout/tests/embed_macros.rs - embedding macros
  • standout/tests/dispatch_derive.rs - dispatch derive macro