🦆 waddling-errors
Core library for the Waddling Diagnostic Protocol (WDP).
What This Library Provides
- Core types:
Code<C, P>,Severity,ComponentId,PrimaryIdtraits - Doc generation: HTML, JSON, and catalog renderers
- Catalog formats: Full, Compact, Minimal (WDP Part 9a compliant)
- Custom renderers: Implement
Renderertrait for your own formats - Role-based filtering: Control what documentation each audience sees
For an easier API with compile-time validation, see waddling-errors-macros. The macros let you define your own module structure—components, primaries, sequences are just conventions, not requirements.
Installation
[]
= "0.7"
For documentation generation:
= { = "0.7", = ["doc-gen"] }
Core Usage
Define components and primaries, then create codes:
use ;
const EXPIRED: = error;
println!; // E.Auth.Token.001
Documentation Generation
Generate HTML docs, JSON, or WDP-compliant catalogs:
use ;
let mut registry = new;
// Register errors, components, primaries...
registry.add_error;
// Generate outputs
registry.generate?;
registry.generate?;
registry.generate?;
Catalog Formats
use CatalogRenderer;
new // Full - all fields, for development
compact // Compact - smaller, for production
minimal // Minimal - smallest, hash-to-code only
Custom Renderers
Implement the Renderer trait:
use ;
;
HTML Customization
use ;
let renderer = new
.with_customization;
Feature Flags
| Feature | Description | Default |
|---|---|---|
macros |
Re-export macros | Yes |
std |
Standard library | No |
doc-gen |
Documentation generation (requires std) | No |
metadata |
Compile-time metadata | No |
serde |
Serialization | No |
Default: no_std + alloc. For bare metal: default-features = false.
Documentation
License
MIT or Apache-2.0.