Expand description
§waddling-sequences
Standard error sequence definitions for the Waddling ecosystem
This crate provides standardized sequence numbers with semantic meanings that are consistent across all Waddling projects, following the WDP Part 6: Sequence Conventions specification.
§Quick Start
use waddling_sequences::input_validation::*;
const MY_ERROR: u16 = MISSING; // 001 - always means "missing"
const OTHER_ERROR: u16 = MISMATCH; // 002 - always means "mismatch"§Module Organization (WDP-6 Sections)
input_validation- Input/Data Validation (001-010): MISSING, INVALID, OUT_OF_BOUNDS, etc.state_lifecycle- State/Lifecycle (011-020): UNINITIALIZED, CLOSED, TIMEOUT, STALE, etc.resource_storage- Resource/Storage (021-030): NOT_FOUND, CONFLICT, UNAVAILABLE, DISCONNECTED, etc.success- Success/Completion (998-999): PARTIAL, COMPLETE
§Benefits
- ✅ Zero dependencies - Just pure constants
- ✅ Tree-shakeable - Only what you import is compiled in
- ✅ Universal - Works with any error library
- ✅ Consistent - Same meanings across all projects
- ✅ WDP-6 Compliant - Follows official sequence conventions
§Metadata Feature
Enable the metadata feature to access rich documentation at runtime:
#[cfg(feature = "metadata")]
use waddling_sequences::metadata;
#[cfg(feature = "metadata")]
{
let meta = metadata::get(1).unwrap();
println!("{}: {}", meta.name, meta.docs);
// Output: MISSING: Required data not provided
}§WDP-6 Reference
This crate implements the sequence conventions from: WDP Part 6: Sequence Conventions (WDP-6)
All sequence numbers, names, and semantics follow the official specification.
Modules§
- docgen
- Documentation generation (enabled with
doc-genfeature) - input_
validation - Input/Data Validation sequences (001-010)
- macros
- Macro-based sequence definitions (enabled with
macrosfeature) - metadata
- Metadata and documentation (enabled with
metadatafeature) - prelude
- Re-export all sequences for convenience
- resource_
storage - Resource and Storage sequences (021-030)
- state_
lifecycle - State and Lifecycle sequences (011-020)
- success
- Success and completion sequences (998-999)