🦆 waddling-errors-macros
Procedural macros for waddling-errors.
Installation
[]
= "0.7"
= "0.7"
Quick Start
setup!must be called once at crate root before usingdiag!. Module names (components,primaries,sequences) are conventions—use whatever structure fits your project.
// src/lib.rs
use ;
setup!
diag!
// Use it
let error = E_AUTH_TOKEN_EXPIRED;
println!; // E.Auth.Token.017
Macros
setup! - Configure paths (required at crate root)
setup!
component! - Define components
component!
primary! - Define primary categories
primary!
sequence! - Define sequences
sequence!
diag! - Define diagnostics
diag!
Visibility Markers
| Marker | Context | Use Case |
|---|---|---|
'C |
Compile-time only | URLs, code snippets |
'R |
Runtime only | Role, tags |
'CR |
Both | Descriptions, hints |
Role-Based Documentation
diag!
Generate separate docs per role:
Feature Flags
| Feature | Description | Default |
|---|---|---|
metadata |
Compile-time metadata | No |
doc-gen |
Documentation generation | No |
auto-register |
Automatic registration | No |
Documentation
- Macro Guide - Complete syntax reference
- Validation Guide - Compile-time validation
- API Reference
License
MIT or Apache-2.0.