Compost
This library exposes decompose!, a macro to decompose tuples into tuples containing a
subset of their values.
use decompose;
let mut cx = ;
function_taking_subset;
decompose!;
dbg!;
decompose!;
dbg!;
function_taking_subset;
function_taking_subset;
Features
Yes, this library...
- Supports reborrowing (i.e.
decompose!does not consume its input. Once you're done with the borrow, you can reuse the original tuple). - Produces (admittedly pretty ugly) errors at compile time if the tuple cannot be decomposed.
- Supports borrowing mutable, immutable, owned, and smart-pointer wrapped (so long as they implement
Borrow) components. - Supports
no_stdenvironments. - Has zero runtime dependencies.