peel-off
Peel off a specific variant from a Rust enum, splitting it into the extracted variant and the residual.
This is useful for error handling where you want to extract and propagate one specific error variant (e.g., a forwarding/retry error) while handling the rest locally.
Usage
use Peel;
// An error enum with a variant you want to peel off
// The remaining variants after peeling
Peeling a Result directly
The blanket impl on Result<T, E: Peel> lets you call .peel() without
unwrapping the error first. Combined with ?, the peeled variant propagates
automatically:
License
MIT