2 unstable releases
Uses new Rust 2024
| 0.2.0 | Sep 29, 2025 |
|---|---|
| 0.1.0 | Sep 25, 2025 |
#2 in #staging
Used in staging
12KB
247 lines
staging
staging is a crate that streamlines validation of multiple fields before returning errors.
Rust has good ergonomics for early return in error cases using the ? operator,
but early return is sometimes undesirable:
- Callers will have to make multiple calls to find all the errors in their request
- Early return can disclose validation ordering, which may be a security issue
Usage
Derive Staging on a struct Example gives you:
- A new struct
ExampleStagingwhere all the fields are nowResult<_, Error> - A
TryFrom<ExampleStaging>impl for the deriving struct
Dependencies
~0.5–1MB
~21K SLoC